aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/_jsx
diff options
context:
space:
mode:
authorwoojiq2023-08-07 19:07:56 +0000
committerGitHub2023-08-07 19:07:56 +0000
commit7cda5b85920f875052438791f01246a408ee490e (patch)
treee1386c8e3e485d29c9bad77e476f049712cdc12e /runtime/queries/_jsx
parent7af37bb3b96104b82e56d0072ca0d9a7b226c141 (diff)
build(tree-sitter): update javascript, typescript and tsx (#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@186f2adbf790552b354a9ba712341c7d48bdbccd. * fix(highlight): change jsx queries to match latest tree-sitter Latest tree-sitter/tree-sitter-javascript@bb1f97b643b77fc1f082d621bf533b4b14cf0c3 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.
Diffstat (limited to 'runtime/queries/_jsx')
-rw-r--r--runtime/queries/_jsx/highlights.scm18
-rw-r--r--runtime/queries/_jsx/indents.scm1
2 files changed, 3 insertions, 16 deletions
diff --git a/runtime/queries/_jsx/highlights.scm b/runtime/queries/_jsx/highlights.scm
index 00641cde..853254e5 100644
--- a/runtime/queries/_jsx/highlights.scm
+++ b/runtime/queries/_jsx/highlights.scm
@@ -4,9 +4,6 @@
(jsx_opening_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
-; Handle the dot operator effectively - <My.Component>
-(jsx_opening_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
-
(jsx_opening_element (identifier) @tag)
; Closing elements
@@ -15,9 +12,6 @@
(jsx_closing_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
-; Handle the dot operator effectively - </My.Component>
-(jsx_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
-
(jsx_closing_element (identifier) @tag)
; Self-closing elements
@@ -26,9 +20,6 @@
(jsx_self_closing_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
-; Handle the dot operator effectively - <My.Component />
-(jsx_self_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
-
(jsx_self_closing_element (identifier) @tag)
; Attributes
@@ -39,17 +30,14 @@
; Punctuation
; -----------
-; Handle attribute delimiter
+; Handle attribute delimiter (<Component color="red"/>)
(jsx_attribute "=" @punctuation.delimiter)
; <Component>
(jsx_opening_element ["<" ">"] @punctuation.bracket)
; </Component>
-(jsx_closing_element ["<" "/" ">"] @punctuation.bracket)
+(jsx_closing_element ["</" ">"] @punctuation.bracket)
; <Component />
-(jsx_self_closing_element ["<" "/" ">"] @punctuation.bracket)
-
-; <> ... </>
-(jsx_fragment ["<" "/" ">"] @punctuation.bracket)
+(jsx_self_closing_element ["<" "/>"] @punctuation.braket)
diff --git a/runtime/queries/_jsx/indents.scm b/runtime/queries/_jsx/indents.scm
index 4731856c..0609aa39 100644
--- a/runtime/queries/_jsx/indents.scm
+++ b/runtime/queries/_jsx/indents.scm
@@ -1,5 +1,4 @@
[
- (jsx_fragment)
(jsx_element)
(jsx_self_closing_element)
] @indent