Fix JSX scanning contexts - #8
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe TSX parser now combines lexical and JSX scanning, keeps JSX text separate from semantic classification, handles multiline tags and expressions, and corrects quote and brace boundary handling. Regression tests cover JSX text, attributes, fragments, generics, nesting, and token reconstruction. ChangesTSX parser correction
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant collectScriptRanges
participant collectScriptInitialRanges
participant semanticPatterns
collectScriptRanges->>collectScriptInitialRanges: scan script syntax and JSX structure
collectScriptInitialRanges->>collectScriptRanges: return lexical ranges and JSX-text ranges
collectScriptRanges->>semanticPatterns: apply semantic patterns outside JSX text
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/internal/script.ts`:
- Line 416: Update findQuotedEnd and the callers used by findTagEnd and raw
quoted-source range scanning so JSX attribute strings continue through newline
characters and close only at their matching quote. Preserve newline termination
for JavaScript template and string literal handling, and ensure multiline JSX
attributes do not cause later quotes to open unintended lexical ranges.
- Around line 199-207: Update the recursive collectScriptInitialRanges call in
the nested JSX attribute-expression path to enable JSX scanning and pass the
shared jsxText mask, preserving the existing range and boundary arguments. Add a
registry regression covering nested JSX such as child={<Label>can't</Label>} and
verify the nested tag is classified correctly.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6c17674a-dbc7-4b15-b692-e13276fa1fdd
📒 Files selected for processing (2)
src/internal/script.tstest/regressions.test.ts
Changes
Fixes #5
Fixes #6
Fixes #7
Release impact: patch release of
@tanstack/highlight.Validation
pnpm run verifySummary by CodeRabbit
Bug Fixes
Tests