Renaming rust modules #8923
Replies: 2 comments 5 replies
-
This should be reported against rust-analyzer instead - rust-analyzer should be sending changes to that update the references. |
Beta Was this translation helpful? Give feedback.
-
Ah ok, I can reproduce this on rust-analyzer's current master ( When we send the rename, rust-analyzer gives us only a resource operation to rename the file.
While Neovim gets a whole set of edits including the file rename operation:
Neovim doesn't declare willRename support in its capabilities so it gets a different set of edits from rust-analyzer. If you comment this line: Line 562 in b023faa then Helix and nvim behave the same. Since we declare willRename support, we need to use it to handle rename resource operations from text document edits. I'll add an issue with the details. (#8942) |
Beta Was this translation helpful? Give feedback.
-
Performing a rename on
mod foobar
oruse foobar
seems to rename the associated files, but not the references to it.So if you have something like:
lib.rs
:main.rs
:Renaming the symbol
foobar
tobaz
will cause a file change:But all the references in the code stay the same:
lib.rs
:I've tested this on VSCode (using the same toolchain) and it works as expected. But I don't think this is an LSP extension AFAIK. Interestingly, using the new
:move
command renames everything correctly.Beta Was this translation helpful? Give feedback.
All reactions