nvim-treesitter/queries/hcl/highlights.scm

90 lines
1.1 KiB
Scheme
Raw Normal View History

2021-06-28 19:11:33 +02:00
; highlights.scm
[
"!"
"\*"
"/"
"%"
"\+"
"-"
">"
">="
"<"
"<="
"=="
"!="
"&&"
"||"
] @operator
[
"{"
"}"
"["
"]"
"("
")"
2021-06-28 20:05:27 +02:00
] @punctuation.bracket
2021-06-28 19:11:33 +02:00
[
"."
2021-06-28 20:05:27 +02:00
".*"
2021-06-28 19:11:33 +02:00
","
2021-06-28 20:05:27 +02:00
"[*]"
] @punctuation.delimiter
2021-06-28 19:11:33 +02:00
[
(ellipsis)
"\?"
"=>"
2021-06-28 20:05:27 +02:00
] @punctuation.special
2021-06-28 19:11:33 +02:00
2021-06-30 23:39:24 +02:00
[
":"
"="
] @none
2021-06-28 19:11:33 +02:00
[
"for"
"in"
] @repeat
[
"if"
] @conditional
[
(quoted_template_start) ; "
(quoted_template_end); "
(template_literal) ; non-interpolation/directive content
2021-06-28 19:11:33 +02:00
] @string
2021-06-30 23:39:24 +02:00
[
(heredoc_identifier) ; <<END
(heredoc_start) ; END
] @punctuation.delimiter
2021-06-30 23:39:24 +02:00
( template_interpolation
[
(template_interpolation_start) ; ${
(template_interpolation_end) ; }
] @punctuation.bracket
)
2021-06-28 20:05:27 +02:00
2021-06-28 19:11:33 +02:00
(numeric_lit) @number
(bool_lit) @boolean
(null_lit) @constant
(comment) @comment
2021-07-01 08:43:42 +02:00
(identifier) @variable
2021-06-28 19:11:33 +02:00
2021-06-30 23:39:24 +02:00
(block (identifier) @type)
2021-06-28 19:11:33 +02:00
(function_call (identifier) @function)
2021-07-01 08:43:42 +02:00
(attribute (identifier) @field)
2021-06-28 19:11:33 +02:00
; { key: val }
;
; highlight identifier keys as though they were block attributes
(object_elem key: (expression (variable_expr (identifier) @field)))
2021-06-28 19:11:33 +02:00
(ERROR) @error