Title: "Move to file" on global code unnecessarily imports/exports, generates invalid code · Issue #58801 · microsoft/TypeScript · GitHub
Open Graph Title: "Move to file" on global code unnecessarily imports/exports, generates invalid code · Issue #58801 · microsoft/TypeScript
X Title: "Move to file" on global code unnecessarily imports/exports, generates invalid code · Issue #58801 · microsoft/TypeScript
Description: // main.ts interface String { malkovich(): string; } [|String.prototype.malkovich = function (): string { return "malkovich"; }|] Select the range. Request "move to a new file" Current // newFile.ts import { String } from "./strs"; Strin...
Open Graph Description: // main.ts interface String { malkovich(): string; } [|String.prototype.malkovich = function (): string { return "malkovich"; }|] Select the range. Request "move to a new file" Current // newFile.t...
X Description: // main.ts interface String { malkovich(): string; } [|String.prototype.malkovich = function (): string { return "malkovich"; }|] Select the range. Request "move to a new file" ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58801
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Move to file\" on global code unnecessarily imports/exports, generates invalid code","articleBody":"```ts\r\n// main.ts\r\n\r\ninterface String {\r\n malkovich(): string;\r\n}\r\n\r\n[|String.prototype.malkovich = function (): string {\r\n return \"malkovich\";\r\n}|]\r\n```\r\n\r\n1. Select the range.\r\n2. Request \"move to a new file\"\r\n\r\n## Current\r\n\r\n```ts\r\n// newFile.ts\r\nimport { String } from \"./strs\";\r\n\r\nString.prototype.malkovich = function (): string {\r\n return \"malkovich\";\r\n};\r\n\r\n// main.ts\r\nexport export export export export export export interface String {\r\n malkovich(): string;\r\n}\r\n\r\nexport export export export export export \r\n```\r\n\r\n## Expected\r\n\r\n```ts\r\n// newFile.ts\r\nString.prototype.malkovich = function (): string {\r\n return \"malkovich\";\r\n};\r\n\r\n// main.ts\r\ninterface String {\r\n malkovich(): string;\r\n}","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2024-06-07T17:14:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/58801/TypeScript/issues/58801"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1616a81c-1474-9a27-3a69-7fd366f15563 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C30:2DD2AD:2F648F:3E5C99:6A616179 |
| html-safe-nonce | cd790dfd5c0fd90b2f498f90ca2ea5c00ed6cc0da523f1bc3976029df6921e0a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzMwOjJERDJBRDoyRjY0OEY6M0U1Qzk5OjZBNjE2MTc5IiwidmlzaXRvcl9pZCI6IjIyNzc3MTgzNjI1NTM0MDk5MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0311353d2988442ead88196828e9086cb1dc28442e6800d3707e992c1476daf |
| hovercard-subject-tag | issue:2340866876 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/58801/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df9522081bebbb5b148c5d59b09f6668fc1cacdbc1cf48207c0566d52183b475/microsoft/TypeScript/issues/58801 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df9522081bebbb5b148c5d59b09f6668fc1cacdbc1cf48207c0566d52183b475/microsoft/TypeScript/issues/58801 |
| og:image:alt | // main.ts interface String { malkovich(): string; } [|String.prototype.malkovich = function (): string { return "malkovich"; }|] Select the range. Request "move to a new file" Current // newFile.t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5f67bc431418961e0814f1eb30a4231250e4726d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width