Improve unknown file type handling in language server #1455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.