Conversation
|
//cc @mjbvz |
|
We also need to consider |
|
Ok, I think this flow makes sense and the api looks good. We may also need an api to check if any renames are necessary so we can avoid prompting the user in cases with loose files |
src/services/tsconfig.json
Outdated
| "navigateTo.ts", | ||
| "navigationBar.ts", | ||
| "organizeImports.ts", | ||
| "../services/renameFile.ts", |
src/services/services.ts
Outdated
| return OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences); | ||
| } | ||
|
|
||
| function renameFile(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings): ReadonlyArray<FileTextChanges> { |
There was a problem hiding this comment.
the name makes me think there is will rename the file as well.. how about getEditsForFileRename
|
@sheetalkamat What's a good way to get access to the |
|
@Andy-MS the soruceFile for the tsconfig.json is stored in |
|
FWIW: most IDEs I’ve used, asked me – before the file was actually moved: “Do you also want to update references?” |
|
Is this supposed to work for renaming folders as well? It doesn't seem to in VS Code 1.24 / TypeScript 2.9.1. |
|
Folder rename should be working in |
|
Filed #24904 to track folder renames. |
Here's how I think it would work:
This is a bit tricky on the tsserver side since we need to be able to figure out what unresolved imports could have resolved to. This meant I had to leave
moduleResolutionCachearound so we could look at the failed lookup locations for failed imports.Fully expecting to need a lot of revision on this. CC @mjbvz for protocol review.