- 
                Notifications
    
You must be signed in to change notification settings  - Fork 730
 
Implement more handling of client capabilities #1998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
      
          
      
      
            jakebailey
  
      
      
      commented
        Nov 1, 2025 
      
    
  
- 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.
 
There was a problem hiding this 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 | 
There was a problem hiding this 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.