-
Notifications
You must be signed in to change notification settings - Fork 378
Description
This popped up in Rust-Analyzer and we are unsure whether its a bug in the client or us implementing it wrong rust-lang/rust-analyzer#7916
Basically when the user renames a module in the source via the rename action rust-analyzer replies with a WorkspaceEdit that renames all locations as well as file names that are affected. This in turn seems to cause vscode to trigger one or more WillRenameFiles requests for which we reply with the same WorkspaceEdit as this is basically the same rename request in this case. This causes two renames to be applied per reference causing incorrect text edits.
We assume that VSCode should not react with a WillRenameFiles request when the file renames are caused by the server, is this assumption wrong? If yes what should be done by the server to prevent this as the documentation doesn't make this clear to us https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#workspace_willRenameFiles