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.
cc @cdietrich the behavior implemented in DocumentUpdateHandler can also be implemented in the DocumentBuilder#update method directly in the existing version of 3.0.
Closes https://github.com/eclipse-langium/langium/issues/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.