-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
lsp-embedded-request-forwarding: Help wanted to generate syntax errors from embedded language #430
Comments
Assigning to @aeschli One tip: LSP in 3.17 will provide a diagnostic pull model that will make this easier. |
I fixed the doc. Once LSP 3.17 is shipped, we need an equivalent vscode diagnostics provider APIs and we need to update our language extensions (in particular css and TypeScript) to adopt it. |
LSP 3.17 is the current version and I see the following new requests:
And I see that CSS, JSON and HTML already have support for these new requests: microsoft/vscode#149972 When searching in the vscode repository, I found the following issue about diagnostic pull APIs: microsoft/vscode#112501 but it got closed and the APIs aren't in vscode (I didn't find any of them in https://code.visualstudio.com/api/references/vscode-api). In the request forwarding example, vscode commands are being used to forward the request. However there are no vscode commands to get the diagnostics of a document (I didn't find anything on https://code.visualstudio.com/api/references/commands): This brings me to a dead end. I tried to use It's frustrating how much digging I need to do to find an answer when the docs say it'll be supported in LSP 3.17. Rather than saying it will be supported in LSP 3.17, it would be handy to know when it'll be supported in vscode. |
I embedded JavaScript in another language by using the "Request Forwarding" approach. It worked well for code completion. Now I want also to get the syntax errors from the embedded JavaScript, but I don't have clue how to get in there.
I did see a relevant sentence in the documentation of VSCode:
https://code.visualstudio.com/api/language-extensions/embedded-languages#conclusion
I assume the
+
sign should have been a-
sign, since it says the "Request forwarding" DOES NOT work with diagnostics errors. I could also interpret that the+
sign is correct, but theNOT
shouldn't have been there. Did I understand correctly?I tried the build-in HTML language server in VSCode, and I was able to see the syntax errors from the embedded JavaScript. However, it may be using a different approach.
My question: if diagnostics errors from embedded language server would be possible, how to do that and what VSCode extension APIs should be used to retrieve the errors and bring these errors to the containing language?
Any help is much appreciated! Thanks.
The text was updated successfully, but these errors were encountered: