feat: bump tree-sitter-javascript to 0.25, update CI and regenerate parsers#357
Draft
rbonestell wants to merge 4 commits intotree-sitter:masterfrom
Draft
feat: bump tree-sitter-javascript to 0.25, update CI and regenerate parsers#357rbonestell wants to merge 4 commits intotree-sitter:masterfrom
rbonestell wants to merge 4 commits intotree-sitter:masterfrom
Conversation
Bump tree-sitter-javascript to ^0.25.0, tree-sitter-cli to ^0.25.8, and tree-sitter peer dependency to ^0.25.0. Add tree-sitter as devDependency for node binding tests.
Update rules for tree-sitter-javascript 0.25.0 compatibility: remove 'using' prefix from assignment_expression (now handled by upstream using_declaration), simplify decorator_parenthesized_expression to accept any expression. Add corpus tests for using declarations (plain, typed, await using, for-of). Fix JSDoc lint errors (@return -> @returns).
Update setup-action/cli to v2 and parser-test-action to v3. Pin node-version to 22 for native binding compatibility. Migrate known parse failures to invalid-files.
|
Thanks for putting this together. I tested this branch locally and found the corresponding issue on the TSX side as well: Examples I used include:
I also hit this in JSX inside object property values with attributes like I fixed this on top of your branch here: Please feel free to reuse or cherry-pick that commit if helpful. I validated this locally against the affected TSX corpus cases, but I did not run the full CI matrix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates tree-sitter-typescript to track tree-sitter-javascript 0.25.0 and tree-sitter-cli 0.25.8, with regenerated parsers using tree-sitter v0.26.6.
Also fixes two reserved-word parsing regressions introduced by the 0.25 upgrade.
Resolves #345
Changes
tree-sitter-javascriptto ^0.25.0,tree-sitter-clito ^0.25.8,tree-sitterpeer to ^0.25.0usingprefix fromassignment_expression(now handled by upstreamusing_declaration)decorator_parenthesized_expressionto accept any expressionjsx_keyword_identifierrule allowing JS reserved words (class,for,const,delete, etc.) and contextual keywords (get,set,async,await,static,let) as JSX tag names, attribute names, and member expression components_jsx_identifierto include keyword identifiersjsx_member_expressionrule for dotted keyword access (e.g.<Foo.class />)_jsx_element_nameto usejsx_member_expressiontsx_jsx_identifiers.txt)?.)reserved('properties', ...)mechanism allows keywords as property identifiers after.but fails after?.in the TypeScript grammar due to parser state table interactions with the larger rule set_keyword_identifierrule and overridemember_expressionto include it as an explicit fallbackfield('optional_chain', $.optional_chain)incall_expressionto match upstream JS grammar structurea?.delete(b),myMap?.delete(key),a?.class,a?.returnusingdeclarations (plain, typed,await using,for-of)setup-action/clito v2 andparser-test-actionto v3node-versionto 22 for native binding compatibility!filesexclusions toinvalid-filesdefine-grammar.js(@return→@returns)Prerequisites
Waiting on tree-sitter/tree-sitter-javascript#378 at which point I will update the reference to the new version of that package and clean up the
invalid-filesin ci.yml.