Debian Codegraph @

runtime/queries/hcl/highlights.scm

raw symbols SCIP
1 [
2 "if"
3 "else"
4 "endif"
5 ] @keyword.control.conditional
6
7 [
8 "for"
9 "endfor"
10 "in"
11 ] @keyword.control.repeat
12
13 [
14 ":"
15 "="
16 ] @none
17
18 [
19 (ellipsis)
20 "\?"
21 "=>"
22 ] @punctuation.special
23
24 [
25 "."
26 ".*"
27 ","
28 "[*]"
29 ] @punctuation.delimiter
30
31 [
32 "{"
33 "}"
34 "["
35 "]"
36 "("
37 ")"
38 ] @punctuation.bracket
39
40 [
41 "!"
42 "\*"
43 "/"
44 "%"
45 "\+"
46 "-"
47 ">"
48 ">="
49 "<"
50 "<="
51 "=="
52 "!="
53 "&&"
54 "||"
55 ] @operator
56
57 (identifier) @variable
58
59 ; { key: val }
60
61 (object_elem val: (expression
62 (variable_expr
63 (identifier) @type.builtin (#match? @type.builtin "^(bool|string|number|object|tuple|list|map|set|any)$"))))
64
65 ; Member access: the attribute of a traversal (obj.field). Before the builtin
66 ; get_attr rule so path.root / path.module stay @variable.builtin.
67 (get_attr (identifier) @variable.other.member)
68 (get_attr (identifier) @variable.builtin (#match? @variable.builtin "^(root|cwd|module)$"))
69 (variable_expr (identifier) @variable.builtin (#match? @variable.builtin "^(var|local|path)$"))
70 ((identifier) @type.builtin (#match? @type.builtin "^(bool|string|number|object|tuple|list|map|set|any)$"))
71 ((identifier) @keyword (#match? @keyword "^(module|root|cwd|resource|variable|data|locals|terraform|provider|output)$"))
72
73 ; highlight identifier keys as though they were block attributes
74 (object_elem key: (expression (variable_expr (identifier) @variable.other.member)))
75
76 (attribute (identifier) @variable.other.member)
77 (function_call (identifier) @function.method)
78 (block (identifier) @type.builtin)
79
80 (comment) @comment
81 (null_lit) @constant.builtin
82 (numeric_lit) @constant.numeric
83 (bool_lit) @constant.builtin.boolean
84
85 [
86 (template_interpolation_start) ; ${
87 (template_interpolation_end) ; }
88 (template_directive_start) ; %{
89 (template_directive_end) ; }
90 (strip_marker) ; ~
91 ] @punctuation.special
92
93 [
94 (heredoc_identifier) ; <<END
95 (heredoc_start) ; END
96 ] @punctuation.delimiter
97
98 [
99 (quoted_template_start) ; "
100 (quoted_template_end); "
101 (template_literal) ; non-interpolation/directive content
102 ] @string