aboutsummaryrefslogtreecommitdiffstats
path: root/queries/glimmer
diff options
context:
space:
mode:
authorNullVoxPopuli <LPSego3+dev@gmail.com>2021-02-28 18:53:18 -0500
committerStephan Seitz <stephan.lauf@yahoo.de>2021-03-01 01:02:09 +0100
commit90415552c0d04fc7fdb119cb27d91091e8bf3034 (patch)
tree72610a893da6058c1dc0e911121dae7c248a4737 /queries/glimmer
parentAdd branch to glimmer config (diff)
downloadnvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar.gz
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar.bz2
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar.lz
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar.xz
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.tar.zst
nvim-treesitter-90415552c0d04fc7fdb119cb27d91091e8bf3034.zip
Copy highlights suggestion from @theHamsta
Diffstat (limited to 'queries/glimmer')
-rw-r--r--queries/glimmer/highlights.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/queries/glimmer/highlights.scm b/queries/glimmer/highlights.scm
new file mode 100644
index 000000000..df4420234
--- /dev/null
+++ b/queries/glimmer/highlights.scm
@@ -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