-
Notifications
You must be signed in to change notification settings - Fork 327
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
textDocument/publishDiagnostics called multiple times but only one of the file's diagnostics are shown #1587
Comments
@rcjsuen you would need to run and compile VS Code from source :-). The instructions are here: https://github.com/microsoft/vscode/wiki/How-to-Contribute Have you tried to reproduce this with a simple VS Code extension that adds the diagnostics directly in code? |
Sounds painful. :)
Great suggestion. I tried that and couldn't reproduce it. vscode-languageserver-node/client/src/common/client.ts Lines 1694 to 1705 in 8e6bf18
Also cheated with |
@dbaeumer I figured out the problem. It seems like const collection = vscode.languages.createDiagnosticCollection("rcjsuen-testing");
collection.set(vscode.Uri.file("/rcjsuen/testing"), [
new vscode.Diagnostic(new vscode.Range(0, 0, 0, 10), "Error", vscode.DiagnosticSeverity.Error),
new vscode.Diagnostic(new vscode.Range(0, 0, 0, 10), "Hint", vscode.DiagnosticSeverity.Hint),
new vscode.Diagnostic(new vscode.Range(0, 0, 0, 10), "Information", vscode.DiagnosticSeverity.Information),
new vscode.Diagnostic(new vscode.Range(0, 0, 0, 10), "Warning", vscode.DiagnosticSeverity.Warning),
]) |
Looks like this is intentional (microsoft/vscode#45436) and someone else reported this this year (microsoft/vscode#203569). 🤔 |
vscode-languageserver-node/client/src/common/client.ts
Lines 1742 to 1747 in 8e6bf18
I have a language server that boots up and scans the workspace folders. It finds four files to scan and publishes diagnostics for all four of them and only one of them has diagnostics in the "Problems" pane.
I have confirmed with a breakpoint that
this._diagnostics.set(uri, diagnostics);
is called multiple times but only one of the file's diagnostics are being shown. If I try to debug further I am greeted with your standard unreadableextensionHostProcess.js
.The traces for the missing files seem correct and I even made the correct one have an incorrect URI and it still showed up in the "Problems" pane just fine. This is 100% reproducible so I'm not convinced it's some strange race condition...? 🤨 How can I debug the extension so that I can walk through actual VS Code source code instead of looking at the unreadable
extensionHostProcess.js
?The text was updated successfully, but these errors were encountered: