Skip to content
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

Implement textDocument/rename #679

Closed
olafurpg opened this issue Apr 17, 2019 · 6 comments · Fixed by #1048
Closed

Implement textDocument/rename #679

olafurpg opened this issue Apr 17, 2019 · 6 comments · Fixed by #1048
Assignees
Labels
feature-request Used for feature requests

Comments

@olafurpg
Copy link
Member

The rename request is sent from the client to the server to perform a workspace-wide rename of a symbol. https://microsoft.github.io/language-server-protocol/specification#textDocument_rename

Some challenges:

  • overridden methods, should we rename only the focused symbol or all overrides + their implementations? IntelliJ lets you choose the behavior but this UI is not available in LSP (although we can optionally implement it for VS Code).
  • broken code, should we require the sources to compile successfully? I vote for always renaming even in the presence of broken code.
@olafurpg
Copy link
Member Author

Blocked by fix in scalameta/scalameta#1859 to handle renaming of overridden methods in anonymous classes

@olafurpg
Copy link
Member Author

olafurpg commented May 1, 2019

Up for debate: should "rename symbol" work for symbols that are not defined in the workspace? For example, should it be possible to rename references to a class defined in library dependencies? In IntelliJ, the symbol must be defined in the workspace but sometimes this limitation might be undesirable.

@gabro
Copy link
Member

gabro commented May 1, 2019

@olafurpg I'm a bit puzzled by the use case.

If the symbol is defined in a dependency, wouldn't renaming references to that symbol just break the usage site?
I'm sure I'm missing something, can you provide an example?

@olafurpg
Copy link
Member Author

olafurpg commented May 2, 2019

I think you are right, we should restrict rename for symbols that are defined in the workspace.

@olafurpg olafurpg removed this from the Metals v0.6 - Radium milestone May 29, 2019
@tgodzik tgodzik added this to the Metals v0.7 - Thorium milestone Jun 14, 2019
@tgodzik tgodzik added the feature-request Used for feature requests label Jun 17, 2019
@tgodzik tgodzik modified the milestones: Metals v0.8, Metals v0.9.0 Jun 28, 2019
@cb372
Copy link
Contributor

cb372 commented Aug 5, 2019

Is anyone currently working on this?

Just as an anecdotal data point, I just watched a colleague try VS Code + Metals for the first time, discover that they couldn't rename symbols, and switch back to IntelliJ within 5 minutes 😢

@tgodzik
Copy link
Contributor

tgodzik commented Aug 5, 2019

@olafurpg started to work on some necessary work with goto implementation, but not sure when he will be able to finish this. We will most likely plan something after he gets back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used for feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants