Skip to content

Conversation

@jakebailey
Copy link
Member

Fixes #2198

This is something I inadvertently broke in the PR.

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 fixes a bug in JSX folding ranges where JSX elements with property access names (e.g., <Components.Nested>) were not handled correctly. The fix changes from calling .Text() on the tag name node to using scanner.GetTextOfNode(), which properly extracts the full text from the source file.

Key Changes

  • Fixed JSX tag name extraction in folding ranges to support property access expressions
  • Added test coverage for JSX property access in folding ranges

Reviewed changes

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

File Description
internal/ls/folding.go Changed JSX tag name extraction from .Text() method to scanner.GetTextOfNode() to properly handle property access expressions like <Components.Nested>
internal/fourslash/tests/foldingRangeJSXPropertyAccess_test.go Added new test case to verify folding ranges work correctly with JSX property access syntax

@jakebailey jakebailey added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit 25d94f6 Dec 3, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/fix-2198 branch December 3, 2025 21:30
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.

InternalError: panic handling request textDocument/foldingRange with jsx using dot notation

3 participants