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

feat: add didRename LSP notification support #260

Closed
wants to merge 1 commit into from

Conversation

mehalter
Copy link
Contributor

@mehalter mehalter commented Dec 21, 2023

Similar to the built-in willRename LSP client integration, this adds in built-in didRename support. This includes a couple refactors of some internal functions as well as making sure that only successful move operations are communicated in the didRename notification.

So far I have tested to make sure this works with both vtsls and luals which provide import/require updates on didRename and it works great. I have also verified that the old willRename support has not broken by testing with tsserver.

Resolves #259

Here are the LSP spec references used in making this:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_didRename
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didRenameFiles

@mehalter
Copy link
Contributor Author

There are all the rest of the FileOperations part of the LSP spec (willCreateFiles/didCreateFiles/willDeleteFiles/didDeleteFiles notifications/requests) that servers could implement which would be great to support out of the box. I'll be honest, I have no idea what servers even use these so I'm less inclined that it's even necessary to add. But it would be nice to have that sort of support completely native to oil. For now I think it's enough to just have willRenameFiles/didRenameFiles support as they are both very commonly used and add more when people ask for them.

I also may find myself bored one day and decide to open another PR to implement them as well 😅

Let me know if you think it's worth opening an issue regarding the rest of the FileOperations part of the LSP spec or if we just leave it to this random comment.

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

Successfully merging this pull request may close these issues.

feature request: add LSP handler for didRenameFiles
1 participant