Skip to content

Clarify how to support both publish and pull diagnostics #1743

@tristanlabelle

Description

@tristanlabelle

The spec is not clear on whether diagnostics from publish and pull models interact with one another. If a language server reports supporting pull diagnostics, but always returns an empty array from textDocument/diagnostic and keeps publishing diagnostics using textDocument/publishDiagnostic, will the client get confused as to whether there are diagnostics or not? Or would the client manage the two sets of diagnostics independently?

Related: if a server sees the client capabilities support for pull diagnostics and reports supporting pull diagnostics itself, can it then assume that textDocument/diagnostic requests will be coming and it need not ever use textDocument/publishDiagnostic?

This comes into play because I'm working on adding pull diagnostics support to the Swift language server to replace publish diagnostics because it fixes some stale diagnostics issues we're running into. The Swift language server is behind a proxy language server (SourceKit-LSP) serving both Swift and Clang, which makes it more difficult to report capabilities because the capabilities of either language-specific servers may differ, and I want to make sure not to break the Clang server if it only supports publish diagnostics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    *questionIssue represents a question, should be posted to StackOverflow (VS Code)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions