-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'fileToRename' property to RenameInfo #24702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'll get initial support for this in VSCode this month so people using typescript@next can start testing
src/server/protocol.ts
Outdated
* fileName to rename. | ||
* If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. | ||
*/ | ||
fileToRename?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a folder as well.. e.g.
// modules/a/index.ts
export var a;
import * from "./modules/a";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should handle this case too.
And since we are renaming a module, we should also rename its references in tsconfig.json like "files"
/"include"
/"paths"
etc..
I think we should just call in getEditsForFileRename
instead of computing something on the fly.
@Andy-MS please address conflicts + Mohamed's comments |
@mjbvz Good to merge? |
Yes, we don't have support in VS Code for this yet but I'll add it this iteration |
@Andy-MS So is the expected behavior that when triggering rename on an import path in a file, we actually trigger the rename in the vscode file explorer? |
You could do that, which I'm guessing is the simplest way. Another option is to do the rename inline as usual, and change the name of the file without opening the file explorer. |
Ok, just so I make sure I understand what is supported:
|
|
Fixes #24501
Adds a
fileToRename
property toRenameInfo
so that the editor can rename the file instead.