Skip to content

Clarify if/when clients should clear document diagnostics from pull requests #1542

Closed

Description

@symmb

The official VS Code language client clears diagnostics obtained via a document diagnostic pull request when all editor tabs associated with that document are closed. This is handy for servers that implement "single-document" diagnostics (where the diagnostics are only visible while the associated file is open), like the JSON server built into VS Code. However, it's not clear from the specification if this (or similar) behavior is required for clients.

I suppose clients could decide not to implement any behavior like that, if it aligns better with the native way to handle diagnostics? But it's not entirely clear how clients are expected to behave when handling document diagnostics obtained from pull requests and what the standard way to implement "single-document" diagnostics as a server is.

Activity

  1. dbaeumer commented on Sep 6, 2022

    @dbaeumer
    Member

    This is left open on purpose since it depends on what clients want to do with that information. Consider a case where a client renders a diagnostic overlay for files visible in the explorer. In this case an editor is not open however the diagnostics shouldn't be cleared either.

    The rule for the server for document diagnostic pull is the same as for any other language feature request (like hover, ...): the server has to compute an accurate information for the document in that point of time.

    I will close the issue since the pull should behave like any other language request. Please ping if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions