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

Improve unknown file type handling in language server #1455

Merged
merged 3 commits into from Apr 22, 2024

Conversation

msujew
Copy link
Contributor

@msujew msujew commented Apr 16, 2024

Closes #1408

Adds a few safeguards for cases in which the language client sends document updates/LSP requests for unknown file types. This is pretty simple to reproduce by renaming a file to another file that cannot be handled by the language server. For the requirements example, from *.tst to *.tstx.

We now filter those updates out before they arrive at the document builder and handle errors for other LSP requests better by returning a ResponseError instead of throwing an error in the code. This massively improves the UX for any user that hits this behavior by accident.

Also fixes a few exports from the ./lsp folder to enable overrides of existing services.

@msujew msujew added documents Related to building documents and indexing LSP Language Server Protocol integration labels Apr 16, 2024
@msujew
Copy link
Contributor Author

msujew commented Apr 16, 2024

cc @cdietrich the behavior implemented in DocumentUpdateHandler can also be implemented in the DocumentBuilder#update method directly in the existing version of 3.0.

Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@msujew msujew merged commit efbfab3 into main Apr 22, 2024
5 checks passed
@msujew msujew deleted the msujew/filter-file-renames branch April 22, 2024 15:09
@spoenemann spoenemann added this to the v3.1.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documents Related to building documents and indexing LSP Language Server Protocol integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.0: Multi Language cannot handle file renames
2 participants