-
Notifications
You must be signed in to change notification settings - Fork 319
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
Diagnostic pulling could support multiple identifiers to allow for two stage diagnostic retrieval #1466
Comments
Actually the idea is that additional pull providers are registered dynamically. So each registration can have its own identifier and set of attributes. Would that work for you? |
I must be doing the registration wrong then. I'm returning it in my server capabilities: if (this.client.hasPullDiagnosticsCapability) {
result.capabilities.diagnosticProvider = {
identifier: 'pylance',
documentSelector: null,
interFileDependencies: true,
workspaceDiagnostics: initializationOptions.diagnosticMode === 'workspace',
};
} Or are you saying there's a secondary step I can do after that to add more? |
I think this issue is a dupe of microsoft/language-server-protocol#1088, which I believe is asking for the same thing? |
Ah @heejaechang pointed out we could do it this way: The spec says that each dynamic registration has to be a different document selector though. Is that true? |
That request was for the push diagnostics. It basically got added for pull with the identifier. |
This is what I meant with dynamic registration. Having two for the same selector for pull is fine since the identifier is part of the params. Otherwise you couldn't distinguish them. I will add something to the spec. |
Thanks, sounds like it will work then. |
Right now pull diagnostics are registered with a single identifier per server:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics
This limits a server to having to handle all diagnostics through a single pull request.
If multiple identifiers were supported, the server could split its diagnostic computations into different chunks, for example, syntax errors and semantic errors.
I'm proposing a new optional field for DiagnosticOptions:
This could allow multiple diagnostic collections per server, which I think would be implemented here:
vscode-languageserver-node/client/src/common/diagnostic.ts
Lines 420 to 421 in 8e62556
The text was updated successfully, but these errors were encountered: