Skip to content

When renaming module, ensure rename span is just the last component of the path - #27151

Merged
1 commit merged into
masterfrom
fileToRenameSpan
Sep 17, 2018
Merged

1 commit merged into
masterfrom
fileToRenameSpan

Conversation

@ghost

Copy link
Copy Markdown

Sequel to #24702

Discussed with Matt Bierner (@mjbvz) that editors don't want to handle changing complex paths, but changing just the last component is easier.

@mjbvz

Copy link
Copy Markdown

Does this mean that I can trigger a rename anywhere on an import but that we should only actually rename the last component of the path? Or can I now only trigger a rename on the last component of the path.

In the first case, I believe VS Code will need to know the range of the last component of the path (we could add logic on our side to calculate it too but it would be better if this information came from TS). Adding a renameRange property to the RenameInfo could be useful for other cases too, such as allowing users to rename a class by hitting F2 on the class keyword instead of only on the class symbol name

@ghost

Copy link
Copy Markdown
Author

This PR modifies exactly the property you need, triggerSpan. For some reason it looks like we weren't sending that to you before, fixed by #27160.

@ghost
ghost merged commit cfd0a62 into master Sep 17, 2018
@ghost
ghost deleted the fileToRenameSpan branch September 17, 2018 22:26
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants