Skip to content

Conversation

@jakebailey
Copy link
Member

We weren't respecting the client caps for diagnostic features, so were sending data we shouldn't when the client hasn't asked for it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for respecting client diagnostic capabilities in the LSP server. The changes ensure that diagnostic-related information (related diagnostics, tags for unnecessary/deprecated code) is only sent to clients that explicitly support these features, improving LSP protocol compliance.

  • Extracts diagnostic client capabilities from initialization parameters and passes them through the diagnostic pipeline
  • Conditionally includes related information and diagnostic tags based on client capabilities
  • Updates test infrastructure to set default diagnostic capabilities for fourslash tests

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/lsp/server.go Extracts diagnostic client capabilities from initialization params and passes them to ProvideDiagnostics
internal/ls/diagnostics.go Implements capability-aware diagnostic conversion that conditionally includes related information and tags based on client support
internal/fourslash/fourslash.go Adds default diagnostic capabilities for fourslash tests to maintain existing test behavior

@jakebailey jakebailey added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 8ac3092 Oct 30, 2025
28 checks passed
@jakebailey jakebailey deleted the jabaile/diag-client-caps branch October 30, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants