Skip to content

Conversation

@jakebailey
Copy link
Member

  • Handle plaintext-only clients for hover, completion doc.
  • Handle clients that don't support LocationLink in find all ref.
  • Handle clients that can't do hierarchical symbols.

Copilot AI review requested due to automatic review settings November 1, 2025 04:15
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 client capabilities negotiation in the LSP server, allowing the server to respond with appropriate content formats based on client preferences. The changes ensure proper handling of hover content, completion documentation, document symbols, and implementation results according to what the client supports (e.g., markdown vs plaintext, hierarchical vs flat symbols, location links vs simple locations).

Key changes:

  • Added client capability checks for hover, completion, document symbols, and implementations to detect supported formats
  • Modified hover and completion response formatting to respect client-supported content formats (markdown vs plaintext)
  • Added hierarchical vs flat symbol information support based on client capabilities
  • Added LocationLink support for implementations when client supports it

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/lsp/server.go Added helper functions to extract client capabilities and updated handlers to pass these capabilities to language service methods
internal/ls/hover.go Modified hover provider to conditionally format content as markdown or plaintext based on client capabilities
internal/ls/completions.go Updated completion item resolution to use client-preferred documentation format
internal/ls/string_completions.go Updated string literal completion details to pass plaintext format
internal/ls/symbols.go Added support for both hierarchical and flat document symbol formats
internal/ls/findallreferences.go Added LocationLink support for implementations when client supports it
internal/fourslash/fourslash.go Added default capabilities for testing with markdown and plaintext formats

@jakebailey jakebailey requested a review from Copilot November 2, 2025 00:01
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

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

@jakebailey jakebailey added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit ae5d110 Nov 3, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/fix-client-capabilities branch November 3, 2025 19:20
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