Skip to content

feat(diagnostics): support pull diagnostics or document push-only behavior #659

Description

@yhcedpn

Related area

Diagnostics
Configuration

Description

clice currently produces C++ compiler diagnostics during translation-unit compilation, but it does not implement the standard LSP textDocument/diagnostic request. A client requesting document diagnostics receives -32601: method not found.

The server capabilities also do not advertise a diagnosticProvider. This makes clice diagnostics inaccessible to clients that use the pull-diagnostics API instead of consuming textDocument/publishDiagnostics notifications.

This report is about the LSP diagnostic contract, not Visual Studio-specific VCR#### rules. A generic C++ LSP client should not be expected to reproduce Visual Studio's proprietary code-style diagnostic IDs.

Steps to reproduce

  1. Start clice for a Windows MSVC project with a valid compile_commands.json.
  2. Initialize the server with a standard LSP client.
  3. Open a C++ translation unit containing a deliberate semantic error such as an unknown type.
  4. Request textDocument/diagnostic for the document, both without an identifier and with identifiers such as DocumentCompilerSemantic or DocumentAnalyzerSemantic.
  5. Observe -32601: method not found: textDocument/diagnostic.
  6. Observe from the clice session log that compilation still produces diagnostics.

A minimal probe can be as small as:

int diagnostic_probe()
{
    UnknownType value{};
    return value.member;
}

Motivation

Please either:

  • implement standard LSP pull diagnostics and advertise diagnosticProvider, including stable source/code/severity/range fields; or
  • document clearly that clice is push-only for diagnostics and specify the expected publishDiagnostics behavior and payload.

Supporting pull diagnostics would make clice interoperable with generic LSP clients. If push-only is intentional, documenting it would prevent clients from treating method not found as an empty diagnostic result.

The existing clang-tidy tracking issue is related to analyzer coverage, but this report concerns the LSP transport and discoverability of diagnostics.

Activity

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

    feature:diagnosticsDiagnostics and error reportingkind:feature-requestNew feature or improvement requesttriagedProcessed by triage — excluded from future triage runs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions