mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
Copy highlights suggestion from @theHamsta
This commit is contained in:
parent
4868c2117f
commit
90415552c0
1 changed files with 36 additions and 0 deletions
36
queries/glimmer/highlights.scm
Normal file
36
queries/glimmer/highlights.scm
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
; Tags that start with a lower case letter are HTML tags
|
||||||
|
((tag_name) @tag
|
||||||
|
(#match? @tag "^[a-z]"))
|
||||||
|
; Tags that start with a capital letter are Glimmer components
|
||||||
|
((tag_name) @constructor
|
||||||
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
|
(attribute_name) @property
|
||||||
|
|
||||||
|
(string_literal) @string
|
||||||
|
(number_literal) @number
|
||||||
|
(boolean_literal) @boolean
|
||||||
|
|
||||||
|
; == Mustache Statements ===
|
||||||
|
|
||||||
|
; Hightlight the whole statement, to color brackets and separators
|
||||||
|
(mustache_statement) @tag
|
||||||
|
|
||||||
|
; Generic identifiers are variables
|
||||||
|
(identifier) @variable
|
||||||
|
; Helpers are functions
|
||||||
|
(helper_identifier) @function
|
||||||
|
|
||||||
|
(comment_statement) @comment
|
||||||
|
|
||||||
|
(attribute_node "=" @operator)
|
||||||
|
|
||||||
|
(block_params "as" @keyword)
|
||||||
|
(block_params "|" @operator)
|
||||||
|
|
||||||
|
[
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
"</"
|
||||||
|
"/>"
|
||||||
|
] @tag
|
||||||
Loading…
Add table
Add a link
Reference in a new issue