Title: "rename file" and "move to new file" refactors do not work when using `files` · Issue #24857 · microsoft/TypeScript · GitHub
Open Graph Title: "rename file" and "move to new file" refactors do not work when using `files` · Issue #24857 · microsoft/TypeScript
X Title: "rename file" and "move to new file" refactors do not work when using `files` · Issue #24857 · microsoft/TypeScript
Description: TypeScript Version: 2.9.1 Search Terms: files "move to new file" "rename file" Code // tsconfig.json { "files": ["./src/index.ts"] } // ./src/index.ts import foo from './other'; // ./src/other.ts export default {} const bar = {}; Expecte...
Open Graph Description: TypeScript Version: 2.9.1 Search Terms: files "move to new file" "rename file" Code // tsconfig.json { "files": ["./src/index.ts"] } // ./src/index.ts import foo from './other'; // ./src/other.ts e...
X Description: TypeScript Version: 2.9.1 Search Terms: files "move to new file" "rename file" Code // tsconfig.json { "files": ["./src/index.ts"] } // ./src/index.ts import...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/24857
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"rename file\" and \"move to new file\" refactors do not work when using `files`","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.9.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** \r\nfiles \"move to new file\" \"rename file\"\r\n\r\n**Code**\r\n\r\n```json\r\n// tsconfig.json\r\n{\r\n \"files\": [\"./src/index.ts\"]\r\n}\r\n```\r\n\r\n``` ts\r\n// ./src/index.ts\r\nimport foo from './other';\r\n```\r\n\r\n``` ts\r\n// ./src/other.ts\r\nexport default {}\r\n\r\nconst bar = {};\r\n```\r\n\r\n**Expected behavior:**\r\n- When renaming the file `./src/other.ts`, I expect TypeScript/VSCode to prompt me to update the import in `./src/index.ts`.\r\n- When selecting `bar` in `./src/other.ts`, TypeScript/VSCode offers to move this to a new file. When actioning this, I expect this to work.\r\n\r\n(TypeScript knows that `./src/other.ts` is in the project because it is part of the traced dependency graph from the entry file `./src/index.ts`.)\r\n\r\n**Actual behavior:**\r\n- When renaming the file `./src/other.ts`, there is no prompt to update the import.\r\n- When selecting `bar` in `./src/other.ts`, TypeScript/VSCode offers to move this to a new file. When actioning this, nothing happens.\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> \r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nhttps://github.com/Microsoft/vscode/issues/51366\r\nhttps://github.com/Microsoft/TypeScript/pull/23573\r\nhttps://github.com/Microsoft/TypeScript/pull/23726\r\n\r\n---\r\n\r\nA known workaround is to use the `include` option instead of `files`. However, I am curious why this is necessary. I prefer to list the entry file and let TypeScript work the rest out. This is especially helpful when a folder has a combination of source and test files—TypeScript automatically knows not to include the test files because they are not part of the dependency graph.\r\n\r\nIf there is a good reason why these commands/refactors can't work with `files`, could we make the experience clearer? Why is the \"move to new file\" command suggested in VSCode when it leads to nothing? If so, perhaps this is an issue for VSCode.","author":{"url":"https://github.com/OliverJAsh","@type":"Person","name":"OliverJAsh"},"datePublished":"2018-06-11T11:02:16Z","url":"https://github.com/microsoft/TypeScript/issues/24857"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:650a0bb1-4894-8dec-3f08-b6ba60051ad9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3C8:26ECEB:26ADEBD:312A069:6B017FE1 |
| html-safe-nonce | e829476481cf930f276684ae595069308c6a9a2ec78e051e6a6a031e2f02f822 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0M4OjI2RUNFQjoyNkFERUJEOjMxMkEwNjk6NkIwMTdGRTEiLCJ2aXNpdG9yX2lkIjoiNTQ5MzUxNzU4NTc2NzAzODk0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d0cea8c261b8872a5adec284d83798a9af13b9b34a5be1bd7af03f38756f4644 |
| hovercard-subject-tag | issue:331141953 |
| 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/24857/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfca09b3a3919edf78d78fd3683472f0374d03d8863505da0dc0acc1756968ea/microsoft/TypeScript/issues/24857 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfca09b3a3919edf78d78fd3683472f0374d03d8863505da0dc0acc1756968ea/microsoft/TypeScript/issues/24857 |
| og:image:alt | TypeScript Version: 2.9.1 Search Terms: files "move to new file" "rename file" Code // tsconfig.json { "files": ["./src/index.ts"] } // ./src/index.ts import foo from './other'; // ./src/other.ts e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OliverJAsh |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width