nvim-treesitter/queries/hcl/highlights.scm

100 lines
1.4 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"
2021-09-20 21:58:20 +02:00
"endfor"
2021-06-28 19:11:33 +02:00
"in"
] @repeat
2023-01-25 14:04:07 -05:00
[
2021-06-28 19:11:33 +02:00
"if"
2021-09-20 21:58:20 +02:00
"else"
"endif"
2021-06-28 19:11:33 +02:00
] @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
[
2022-04-24 23:16:35 +02:00
(heredoc_identifier) ; END
(heredoc_start) ; << or <<-
] @punctuation.delimiter
2021-06-30 23:39:24 +02:00
2021-09-20 21:58:20 +02:00
[
(template_interpolation_start) ; ${
(template_interpolation_end) ; }
(template_directive_start) ; %{
(template_directive_end) ; }
(strip_marker) ; ~
] @punctuation.special
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
2022-11-20 16:32:52 +11:00
(comment) @comment @spell
2021-07-01 08:43:42 +02:00
(identifier) @variable
2021-06-28 19:11:33 +02:00
(body (block (identifier) @keyword))
(body (block (body (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)))
; var.foo, data.bar
;
; first element in get_attr is a keyword or a reference to a keyword
2023-01-25 14:04:07 -05:00
(expression (variable_expr (identifier) @variable.builtin) (get_attr (identifier) @field))
2021-07-04 15:32:26 -06:00
2021-06-28 19:11:33 +02:00
(ERROR) @error