Skip to content

fix: match TSX highlighting roles in TSRX - #101

Merged
leonidaz merged 9 commits into
tsrx-org:mainfrom
jonkwheeler:jon/intellij-tsx-highlighting-parity
Sep 16, 2026
Merged

leonidaz merged 9 commits into
tsrx-org:mainfrom
jonkwheeler:jon/intellij-tsx-highlighting-parity

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

TSRX files now preserve shared TSX highlighting roles across JSX structure and embedded members in WebStorm, including JSX reached after multiline expression boundaries. Guarded grammar entry keeps comparison, shift, generic-call, generic-arrow, and type syntax out of JSX while a narrow IntelliJ adapter closes the member-role gap without requiring the JavaScript plugin.

This is the syntax-color parity slice of issue 100. Rainbow Brackets support remains separate follow-up work.

Design decisions

  • The canonical TextMate grammar remains the source of JSX recognition for every editor consumer.
  • IntelliJ remaps only property and method leaf scopes inside TSRX JSX expressions, delegates every unrelated token, and uses theme keys rather than hard-coded colors.
  • Automated parity compares real fallback-key identities for WebStorm roles; lexical scope assertions remain in the shared grammar suite.

Validation

  • VS Code grammar project: 2 files, 15 tests passed, including multiline JSX and tag-shaped comparison regressions.
  • IntelliJ package project: 1 file, 11 tests passed.
  • Gradle test, verifyPluginProjectConfiguration, buildPlugin, verifyPluginStructure, and verifyPlugin passed; Plugin Verifier reports compatibility with WS-252.27397.92.
  • TextMate plist regeneration produced the same SHA-256 twice: c2f3adf79c8b8c88af2e2457e23918a6de8ee89326bb87ded5d3580878a80f48.
  • Changeset checks and focused formatting checks passed.

Unapplied review findings

  • Install the built ZIP in WebStorm 2025.2.4 under Darcula and compare the paired issue fixtures. The automated environment had no safe scriptable GUI profile; packages/intellij-plugin/DEVELOPMENT.md records the exact side-by-side procedure.

Related: #100

Session-settled decisions carried from planning: syntax-color parity first (user-approved, over bundling Rainbow Brackets); token-role parity within one theme (user-approved, over pixel-identical native semantic highlighting).


Compound Engineering


Note

Low Risk
Changes are limited to TextMate scopes and an IntelliJ syntax-highlighter adapter with broad automated tests; no runtime, auth, or data-path impact.

Overview
Improves TSRX JSX syntax-color parity with TSX (issue #100) by fixing TextMate recognition of JSX after multiline expression boundaries and tightening how member calls vs standalone calls are scoped inside {…}.

The shared grammar now wires JSX tag rules into expressionWithoutIdentifiers and tags dotted callees with meta.method-call.js so map-style members differ from bare format() calls. VS Code gets expanded grammar tests for multiline JSX, comparison/generic false positives, and method vs function roles.

IntelliJ/WebStorm no longer uses the stock TextMate highlighter alone: TsrxSyntaxHighlighterFactory delegates to TextMate but only augments property/method tokens inside JSX embedded expressions with WebStorm theme keys (TS.INSTANCE_MEMBER_*), leaving other tokens unchanged. Plugin docs add a manual Darcula side-by-side check against paired issue-100 fixtures.

Reviewed by Cursor Bugbot for commit 16949e3. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

@jonkwheeler is attempting to deploy a commit to the Ripple Team Team on Vercel.

A member of the Team first needs to authorize it.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

- avoid the key probe's fixture identifier collision
@leonidaz
leonidaz self-requested a review September 16, 2026 16:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 755fd42. Configure here.

Comment thread grammars/textmate/tsrx.tmLanguage.json Resolved
@leonidaz
leonidaz merged commit 1c9d76a into tsrx-org:main Sep 16, 2026
9 of 11 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 16, 2026
leonidaz added a commit that referenced this pull request Sep 16, 2026
* fix(grammar): recognize multiline JSX expression boundaries

* fix(intellij): align embedded JSX member roles

* chore: publish JSX highlighting parity

* fix(review): apply review findings

* fix(ci): make highlighting fixtures format-stable

* Address PR review feedback (#101)

- avoid the key probe's fixture identifier collision

* feat(intellij): analyze rainbow bracket structure

* feat(intellij): integrate optional Rainbow Brackets

* test(intellij): prove Rainbow Brackets integration

* docs(intellij): document Rainbow compatibility

* perf(intellij): keep rainbow highlighting linear

* fix(review): apply rainbow findings #1-#4

* docs(plan): record Rainbow Brackets delivery

* fix(intellij): preserve nested JSX and align rainbow color cycles

* chore: remove local Rainbow Brackets plan

* style(intellij): format Rainbow Brackets fixture

* test(intellij): use implicit output in template fixtures

---------

Co-authored-by: Leonidas <[email protected]>
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