Skip to content
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

vscode.languages.onDidChangeDiagnostics Does Not Provide Document URI #49582

Closed
daytonellwanger opened this issue May 9, 2018 · 1 comment
Closed
Assignees
Labels
api languages-diagnostics Source problems reporting verified Verification succeeded
Milestone

Comments

@daytonellwanger
Copy link

  • VSCode Version: 1.24.0-insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a VS Code extension that listens for diagnostics changes and looks at the URIs of the documents whose diagnostics have changed. E.g.
vscode.languages.onDidChangeDiagnostics((e: vscode.DiagnosticChangeEvent) => {
            for (let uri of e.uris) {
                console.log(uri.fsPath);
            }
        });
  1. Run this extension alongside the C# extension.
  2. Create an error so that the C# extension reports that a document has diagnostics.
  3. Resolve the error.

EXPECTED:
The onDidChangeDiagnostics callback is called with the URI of the document that went from having diagnostics to having none.
ACTUAL:
The onDidChangeDiagnostics callback is called with no URIs.

This can be worked around by maintaining a list of documents that have diagnostics, and any time we receive a DiagnosticChangeEvent asking VS Code for all diagnostics, and then checking if any documents went from having diagnostics to no longer having them. However, this seems like something VS Code should be handling. It’s also interesting that this doesn’t seem to be a problem for other languages/extensions.

@vscodebot
Copy link

vscodebot bot commented May 9, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jrieken jrieken added api languages-diagnostics Source problems reporting labels May 14, 2018
@jrieken jrieken added this to the May 2018 milestone May 14, 2018
@roblourens roblourens added the verified Verification succeeded label May 31, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api languages-diagnostics Source problems reporting verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants