Until these are in Helix proper, place these in your runtime/queries/kitten folder.
Created
September 2, 2022 09:57
-
-
Save aral/789b0432d4c1a477d7dfd76826a6e43b to your computer and use it in GitHub Desktop.
Kitten runtime queries for Helix Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inherits: javascript | |
; Highlight component names differently | |
(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_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_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))) | |
; TODO: also tag @punctuation.delimiter? | |
(jsx_opening_element (identifier) @tag) | |
(jsx_closing_element (identifier) @tag) | |
(jsx_self_closing_element (identifier) @tag) | |
(jsx_attribute (property_identifier) @variable.other.member) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inherits: javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inherits: javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inherits: javascript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment