Skip to content

jscript: Split JSX out of the JavaScript parser#4379

Open
b4n wants to merge 1 commit intouniversal-ctags:masterfrom
b4n:jscript-jsx-split
Open

jscript: Split JSX out of the JavaScript parser#4379
b4n wants to merge 1 commit intouniversal-ctags:masterfrom
b4n:jscript-jsx-split

Conversation

@b4n
Copy link
Member

@b4n b4n commented Feb 4, 2026

JSX doesn't support XML comments, and their presence can prevent further parsing of JS code embedded in HTML, which is more relaxed about them.

Fix this by separating the JSX from the regular JavaScript parser, as JSX is a JavaScript extension that is not meant to be standardized to JavaScript anyway.

Fixes #4373.

@b4n b4n requested review from jafl and masatake February 4, 2026 21:53
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.91%. Comparing base (1bccbf2) to head (27017db).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4379   +/-   ##
=======================================
  Coverage   85.91%   85.91%           
=======================================
  Files         252      252           
  Lines       62683    62713   +30     
=======================================
+ Hits        53854    53882   +28     
- Misses       8829     8831    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

JSX doesn't support XML comments, and their presence can prevent
further parsing of JS code embedded in HTML, which is more relaxed
about them.

Fix this by separating the JSX from the regular JavaScript parser,
as JSX is a JavaScript extension that is not meant to be standardized
to JavaScript anyway.

Fixes universal-ctags#4373.
@b4n b4n force-pushed the jscript-jsx-split branch from 5943d0b to 27017db Compare February 6, 2026 11:37
@masatake
Copy link
Member

masatake commented Feb 6, 2026

Thank you.

@jafl
Copy link
Contributor

jafl commented Feb 7, 2026

@masatake What is your opinion? Should we merge this?

@masatake
Copy link
Member

masatake commented Feb 8, 2026

Splitting the parser is good.

Parsers should not share kinds, roles, fields, extras, and properties tables.

See the last 4 commits in https://github.com/masatake/ctags/commits/jscript-jsx-split-dont-share-lang-model/

Could you cherry pick masatake@c8b3f99 ?

Could you squash masatake@5cedc18 and masatake@76cf595 into your commit?

Of course, you can change the words in the NEWS file.

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.

JavaScript in HTML: fails to parse after an HTML commen since JSX support

3 participants