Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Dec 11, 2025

Interestingly, VS Code does not request this, nor do we even test it.

Copilot AI review requested due to automatic review settings December 11, 2025 23:25
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 modifies the folding range implementation to respect client capabilities regarding collapsed text. The language server now only sets the CollapsedText field on folding ranges when the client explicitly declares support for this feature via the FoldingRange.FoldingRange.CollapsedText capability.

Key Changes

  • Added supportsCollapsedText helper function to check client capabilities
  • Modified createFoldingRange to conditionally set CollapsedText based on client support
  • Propagated context.Context through all folding range creation functions to enable capability checking
  • Added defaultFoldingRangeCapabilities configuration for tests

Reviewed changes

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

File Description
internal/ls/folding.go Added context parameter to all folding functions; implemented conditional collapsed text setting based on client capabilities
internal/fourslash/fourslash.go Defined default folding range capabilities for testing (including collapsed text support)

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.

2 participants