ballerina-platform / lsp4intellij

This language client library provides language server protocol support for IntelliJ IDEA and other Jetbrains IDEs.
Apache License 2.0
428 stars 104 forks source link

Renaming a file #334

Open payne911 opened 10 months ago

payne911 commented 10 months ago

I'm not entirely sure, but it doesn't seem like lsp4intellij appropriately handles the case where someone renames a class which has an associated file name. It seems to send the didChange notifications to modify the text references in different files, but it won't be able to track new changes done in that file since the textDocument key is now changed. I'm not an LSP expert, but given the file was opened in IntelliJ, shouldn't this trigger a didClose on the old file name, and a didOpen on the new one?

nixel2007 commented 10 months ago

Probably it should send workspace/didRenameFiles (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didRenameFiles)

payne911 commented 8 months ago

Does this library support this already? I can only find references to textDocument/rename (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_rename), which I'm not sure if it does the same thing.