Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(tree-sitter): update javascript, typescript and tsx #7852

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

woojiq
Copy link
Contributor

@woojiq woojiq commented Aug 7, 2023

Closes #7845.

Disclaimer: The quotations below show that this phrase is taken from the relevant upstream commit/pr. This is my first time using this format, so if it's not comfortable, let me know. Just want to provide some guidance to make the PR review as easy as possible (I spent a lot of time jumping between upstream commits and understanding the api changes).

Changes according to tree-sitter/tree-sitter-javascript@186f2ad:

  • rename ?. to optional_chain.

Optional chaining property/array access and optional function calls now produce an optional_chain named field.

Changes according to tree-sitter/tree-sitter-javascript@bb1f97b:

  • Remove some queries with nested_identifier,

Made the Foo.Bar part in <Foo.Bar/> have the same parse tree as in const Component = Foo.Bar using aliases. We get the parse tree (member_expression (identifier) (property_identifier)) instead of (nested_identifier (identifier) (identifier))

  • Remove deprecated jsx_fragment from indent query.

Removed the special treatment of JSX fragments in the grammar.

  • Count </ and /> as a single token.

Made </ and /> single tokens instead of two, makes more sense to me.

woojiq added 2 commits August 7, 2023 16:27
* update revision of tree-sitter parsers for these languages.
* rename `?.` to `optional_chain`, introduced in tree-sitter/tree-sitter-javascript@186f2ad.
Latest tree-sitter/tree-sitter-javascript@bb1f97b added some breaking changes that broke highlighting.
* Remove some queries with `nested_identifier`.
* Remove deprecated `jsx_fragment` from indent query.
* Count `</` and `/>` as a single token.
@archseer archseer requested a review from the-mikedavis August 7, 2023 18:54
@the-mikedavis the-mikedavis merged commit 7cda5b8 into helix-editor:master Aug 7, 2023
@woojiq woojiq deleted the update-js-tree-sitter branch August 7, 2023 20:20
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
…or#7852)

* build(tree-sitter): update javascript, typescript and tsx

* update revision of tree-sitter parsers for these languages.
* rename `?.` to `optional_chain`, introduced in tree-sitter/tree-sitter-javascript@186f2ad.

* fix(highlight): change jsx queries to match latest tree-sitter

Latest tree-sitter/tree-sitter-javascript@bb1f97b added some breaking changes that broke highlighting.
* Remove some queries with `nested_identifier`.
* Remove deprecated `jsx_fragment` from indent query.
* Count `</` and `/>` as a single token.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
…or#7852)

* build(tree-sitter): update javascript, typescript and tsx

* update revision of tree-sitter parsers for these languages.
* rename `?.` to `optional_chain`, introduced in tree-sitter/tree-sitter-javascript@186f2ad.

* fix(highlight): change jsx queries to match latest tree-sitter

Latest tree-sitter/tree-sitter-javascript@bb1f97b added some breaking changes that broke highlighting.
* Remove some queries with `nested_identifier`.
* Remove deprecated `jsx_fragment` from indent query.
* Count `</` and `/>` as a single token.
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
…or#7852)

* build(tree-sitter): update javascript, typescript and tsx

* update revision of tree-sitter parsers for these languages.
* rename `?.` to `optional_chain`, introduced in tree-sitter/tree-sitter-javascript@186f2ad.

* fix(highlight): change jsx queries to match latest tree-sitter

Latest tree-sitter/tree-sitter-javascript@bb1f97b added some breaking changes that broke highlighting.
* Remove some queries with `nested_identifier`.
* Remove deprecated `jsx_fragment` from indent query.
* Count `</` and `/>` as a single token.
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.

Wrong indents after the static initialization block in Javascript
3 participants