aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/twig/highlights.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/twig/highlights.scm')
-rw-r--r--runtime/queries/twig/highlights.scm70
1 files changed, 57 insertions, 13 deletions
diff --git a/runtime/queries/twig/highlights.scm b/runtime/queries/twig/highlights.scm
index 2c95ab63..1ef8d06b 100644
--- a/runtime/queries/twig/highlights.scm
+++ b/runtime/queries/twig/highlights.scm
@@ -1,16 +1,60 @@
-(comment_directive) @comment
+(comment) @comment
+
+(filter_identifier) @function.method
+(function_identifier) @function.method
+(test) @function.builtin
+(variable) @variable
+(string) @string
+(interpolated_string) @string
+(operator) @operator
+(number) @constant.numeric.integer
+(boolean) @constant.builtin.boolean
+(null) @constant.builtin
+(keyword) @keyword
+(attribute) @attribute
+(tag) @tag
+(conditional) @keyword.control.conditional
+(repeat) @keyword.control.repeat
+(method) @function.method
+(parameter) @variable.parameter
[
- "{%"
- "{%-"
- "{%~"
- "%}"
- "-%}"
- "~%}"
- "{{"
- "{{-"
- "{{~"
- "}}"
- "-}}"
- "~}}"
+ "{{"
+ "}}"
+ "{{-"
+ "-}}"
+ "{{~"
+ "~}}"
+ "{%"
+ "%}"
+ "{%-"
+ "-%}"
+ "{%~"
+ "~%}"
] @keyword
+
+[
+ ","
+ "."
+ "?"
+ ":"
+ "="
+] @punctuation.delimiter
+
+(interpolated_string [
+ "#{"
+ "}"
+] @punctuation.delimiter)
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+] @punctuation.bracket
+
+(hash [
+ "}"
+] @punctuation.bracket)
+