Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/_jsx/highlights.scm')
| -rw-r--r-- | runtime/queries/_jsx/highlights.scm | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/runtime/queries/_jsx/highlights.scm b/runtime/queries/_jsx/highlights.scm index 7061b581..70a03091 100644 --- a/runtime/queries/_jsx/highlights.scm +++ b/runtime/queries/_jsx/highlights.scm @@ -1,43 +1,43 @@ +; Punctuation +; ----------- + +; Handle attribute delimiter (<Component color="red"/>) +(jsx_attribute "=" @punctuation.delimiter) + +; <Component> +(jsx_opening_element ["<" ">"] @punctuation.bracket) + +; </Component> +(jsx_closing_element ["</" ">"] @punctuation.bracket) + +; <Component /> +(jsx_self_closing_element ["<" "/>"] @punctuation.bracket) + +; Attributes +; ---------- + +(jsx_attribute (property_identifier) @attribute) + ; Opening elements ; ---------------- +(jsx_opening_element (identifier) @tag) + (jsx_opening_element ((identifier) @constructor (#match? @constructor "^[A-Z]"))) -(jsx_opening_element (identifier) @tag) - ; Closing elements ; ---------------- +(jsx_closing_element (identifier) @tag) + (jsx_closing_element ((identifier) @constructor (#match? @constructor "^[A-Z]"))) -(jsx_closing_element (identifier) @tag) - ; Self-closing elements ; --------------------- -(jsx_self_closing_element ((identifier) @constructor - (#match? @constructor "^[A-Z]"))) - (jsx_self_closing_element (identifier) @tag) -; Attributes -; ---------- - -(jsx_attribute (property_identifier) @attribute) - -; Punctuation -; ----------- - -; Handle attribute delimiter (<Component color="red"/>) -(jsx_attribute "=" @punctuation.delimiter) - -; <Component> -(jsx_opening_element ["<" ">"] @punctuation.bracket) - -; </Component> -(jsx_closing_element ["</" ">"] @punctuation.bracket) - -; <Component /> -(jsx_self_closing_element ["<" "/>"] @punctuation.bracket) +(jsx_self_closing_element ((identifier) @constructor + (#match? @constructor "^[A-Z]"))) |