on master help sign in
build(tree-sitter): update javascript, typescript and tsx (#7852)
7cda5b8woojiq
languages.toml+3−3
@@ -563,7 +563,7 @@ args = { program = "{0}" }
563
563
564[[grammar]]
564[[grammar]]
565name = "javascript"
565name = "javascript"
566−source = { git = "https://github.com/tree-sitter/tree-sitter-javascript", rev = "4a95461c4761c624f2263725aca79eeaefd36cad" }
566+source = { git = "https://github.com/tree-sitter/tree-sitter-javascript", rev = "f772967f7b7bc7c28f845be2420a38472b16a8ee" }
567
567
568[[language]]
568[[language]]
569name = "jsx"
569name = "jsx"
@@ -590,7 +590,7 @@ indent = { tab-width = 2, unit = " " }
590
590
591[[grammar]]
591[[grammar]]
592name = "typescript"
592name = "typescript"
593−source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "5d20856f34315b068c41edaee2ac8a100081d259", subpath = "typescript" }
593+source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf", subpath = "typescript" }
594
594
595[[language]]
595[[language]]
596name = "tsx"
596name = "tsx"
@@ -604,7 +604,7 @@ indent = { tab-width = 2, unit = " " }
604
604
605[[grammar]]
605[[grammar]]
606name = "tsx"
606name = "tsx"
607−source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "5d20856f34315b068c41edaee2ac8a100081d259", subpath = "tsx" }
607+source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf", subpath = "tsx" }
608
608
609[[language]]
609[[language]]
610name = "css"
610name = "css"
runtime/queries/_jsx/highlights.scm+3−15
@@ -4,9 +4,6 @@
4(jsx_opening_element ((identifier) @constructor
4(jsx_opening_element ((identifier) @constructor
5 (#match? @constructor "^[A-Z]")))
5 (#match? @constructor "^[A-Z]")))
6
6
7−; Handle the dot operator effectively - <My.Component>
8−(jsx_opening_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
9−
10(jsx_opening_element (identifier) @tag)
7(jsx_opening_element (identifier) @tag)
11
8
12; Closing elements
9; Closing elements
@@ -15,9 +12,6 @@
15(jsx_closing_element ((identifier) @constructor
12(jsx_closing_element ((identifier) @constructor
16 (#match? @constructor "^[A-Z]")))
13 (#match? @constructor "^[A-Z]")))
17
14
18−; Handle the dot operator effectively - </My.Component>
19−(jsx_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
20−
21(jsx_closing_element (identifier) @tag)
15(jsx_closing_element (identifier) @tag)
22
16
23; Self-closing elements
17; Self-closing elements
@@ -26,9 +20,6 @@
26(jsx_self_closing_element ((identifier) @constructor
20(jsx_self_closing_element ((identifier) @constructor
27 (#match? @constructor "^[A-Z]")))
21 (#match? @constructor "^[A-Z]")))
28
22
29−; Handle the dot operator effectively - <My.Component />
30−(jsx_self_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
31−
32(jsx_self_closing_element (identifier) @tag)
23(jsx_self_closing_element (identifier) @tag)
33
24
34; Attributes
25; Attributes
@@ -39,17 +30,14 @@
39; Punctuation
30; Punctuation
40; -----------
31; -----------
41
32
42−; Handle attribute delimiter
33+; Handle attribute delimiter (<Component color="red"/>)
43(jsx_attribute "=" @punctuation.delimiter)
34(jsx_attribute "=" @punctuation.delimiter)
44
35
45; <Component>
36; <Component>
46(jsx_opening_element ["<" ">"] @punctuation.bracket)
37(jsx_opening_element ["<" ">"] @punctuation.bracket)
47
38
48; </Component>
39; </Component>
49−(jsx_closing_element ["<" "/" ">"] @punctuation.bracket)
40+(jsx_closing_element ["</" ">"] @punctuation.bracket)
50
41
51; <Component />
42; <Component />
52−(jsx_self_closing_element ["<" "/" ">"] @punctuation.bracket)
43+(jsx_self_closing_element ["<" "/>"] @punctuation.braket)
53−
54−; <> ... </>
55−(jsx_fragment ["<" "/" ">"] @punctuation.bracket)
runtime/queries/_jsx/indents.scm−1
@@ -1,5 +1,4 @@
1[
1[
2− (jsx_fragment)
3 (jsx_element)
2 (jsx_element)
4 (jsx_self_closing_element)
3 (jsx_self_closing_element)
5] @indent
4] @indent
runtime/queries/ecma/highlights.scm+1−1
@@ -109,7 +109,7 @@
109
109
110[
110[
111 ";"
111 ";"
112− "?."
112+ (optional_chain) ; ?.
113 "."
113 "."
114 ","
114 ","
115] @punctuation.delimiter
115] @punctuation.delimiter