on master help sign in
Add JSX highlighting queries
commita24fb17b2a978d3165bd6304e9edd69bddb6dd82 authorBlaž Hrastnik <blaz@mxxn.io> dateFri 1 Apr 2022, 17:14 (5 years ago) parentd0ff2ff
3 files changed+11−7
languages.toml+3−3 runtime/queries/javascript/highlights-jsx.scm−4 runtime/queries/javascript/highlights.scm+8
languages.toml+3−3
@@ -270,7 +270,7 @@ file-types = ["js", "jsx", "mjs"]
270270shebangs = ["node"]
271271roots = []
272272comment-token = "//"
273−# TODO: highlights-jsx, highlights-params
273+# TODO: highlights-params
274274language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascript" }
275275indent = { tab-width = 2, unit = " " }
276276
@@ -297,7 +297,7 @@ injection-regex = "^(ts|typescript)$"
297297file-types = ["ts"]
298298shebangs = []
299299roots = []
300−# TODO: highlights-jsx, highlights-params
300+# TODO: highlights-params
301301language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "typescript"}
302302indent = { tab-width = 2, unit = " " }
303303
@@ -311,7 +311,7 @@ scope = "source.tsx"
311311injection-regex = "^(tsx)$" # |typescript
312312file-types = ["tsx"]
313313roots = []
314−# TODO: highlights-jsx, highlights-params
314+# TODO: highlights-params
315315language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "typescriptreact" }
316316indent = { tab-width = 2, unit = " " }
317317
runtime/queries/javascript/highlights-jsx.scmdeleted−4
@@ -1,4 +0,0 @@
1−(jsx_opening_element (identifier) @tag)
2−(jsx_closing_element (identifier) @tag)
3−(jsx_self_closing_element (identifier) @tag)
4−(jsx_attribute (property_identifier) @attribute)
runtime/queries/javascript/highlights.scm+8
@@ -1,3 +1,11 @@
1+; JSX
2+;----
3+
4+(jsx_opening_element (identifier) @tag)
5+(jsx_closing_element (identifier) @tag)
6+(jsx_self_closing_element (identifier) @tag)
7+(jsx_attribute (property_identifier) @variable.other.member)
8+
19; Special identifiers
210;--------------------
311