-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Pull diagnostics API in Visual Studio Code #159911
Comments
We have no plans to implement a pull diagnostics API for VS Code. For once we don't want to "compete" with the existing push API and more importantly we don't know when to pull for what. Extensions have no means to express inter-file dependencies that would allow us to do qualified "pulling". There it is up to extensions to do this.
This approach isn't suitable when want you to do validation (btw also when having the ability to pull for diagnostics) because it happens without context. A library integration should be used instead |
This means that the comment by @aeschli in microsoft/vscode-extension-samples#430 (comment) will never be implemented?
And the docs change in microsoft/vscode-docs@e885ed2 have no meaning at all? If I would've known that this would never be implemented, I wouldn't have chosen for this path.
We already have multiple |
LSP now has diagnostic pulling and it got adopted by several language servers (JSON / CSS / HTML) a while back and is in use.
@jrieken Check out the protocol that @dbaeumer came up with. There's no need for the client to understand the cross-file dependencies
|
Should this issue be re-opened or is there an issue open that tracks the API? |
The Embedded Programming Languages guide still includes the following reference to this issue:
The phrase "currently does not support" suggests that VS Code will eventually support diagnostic pulling, but this issue suggests otherwise. As mentioned in the comment before me, should this issue be re-opened or should the docs be updated to reflect that this feature is not planned? |
@zachallaun I think it's better to create a new issue. After my comment on 2022 Sep 5, I never received any comments, so I made a new issue on 2022 Nov 10 which received feedback. And my new comment on 2022 Nov 21 never got feedback. I'm not sure if the vscode team gets notifications of closed issues or they aren't being triaged 🥲. |
Please do not create a new issue. We are reading notifications for
@zachallaun you are correct can you please file an issue against vscode-doc so that this gets updated |
Would be great to have it as mentioned in #66982 |
I'm developing an extension for C# WebForms, which is basically an embedded language in HTML. I've created a language server which handles the WebForms language and redirects other ranges to the CSS and JavaScript language server through virtual documents. In the docs, this is called "Request Forwarding": https://code.visualstudio.com/api/language-extensions/embedded-languages#request-forwarding.
Everything works, except one thing: diagnostics.
In the docs it's stated that this will be supported in LSP 3.17, which is now released with the new pull diagnostics messages:
But there is currently no way to get the diagnostics of a virtual document, other than opening the file.
With other API's (for example fetching code completions) we can use commands like
vscode.executeCompletionItemProvider
:https://github.com/microsoft/vscode-extension-samples/blob/d7c486e9c07f91407aed982e16c3839bfa0cefdc/lsp-embedded-request-forwarding/client/src/extension.ts#L60-L65
So I would like a new command that fetches the diagnostics:
vscode.executePullTextDocumentDiagnostics
with the URI as parameter.With an ugly workaround it's possible to fetch diagnostics. I'm opening the text document and then fetching the diagnostics:
The problem is that:
The text was updated successfully, but these errors were encountered: