Debian Codegraph @

runtime/queries/puppet/highlights.scm

raw symbols SCIP
1 ; Variables
2
3 (identifier) @variable
4
5 ; Includes
6
7 "include" @keyword.control.import
8
9 (include_statement (identifier) @type)
10 (include_statement (class_identifier (identifier) @type .))
11
12 ; Keywords
13
14 [
15 "class"
16 "inherits"
17 "node"
18 "type"
19 "tag"
20 ] @keyword
21
22 [
23 "define"
24 "function"
25 ] @keyword.function
26
27 [
28 "if"
29 "elsif"
30 "else"
31 "unless"
32 "case"
33 ] @keyword.control.conditional
34
35 (default_case "default" @keyword.control.conditional)
36
37 ; Attributes
38
39 (attribute name: (identifier) @attribute)
40 (attribute name: (variable (identifier) @attribute))
41
42 ; Parameters
43
44 (lambda (variable (identifier) @variable.parameter))
45
46 (parameter (variable (identifier) @variable.parameter))
47
48 (function_call (identifier) @variable.parameter)
49
50 ; Functions
51
52 (function_declaration
53 "function" . (identifier) @function)
54
55 (function_call
56 (identifier) @function "(")
57
58 (function_call
59 (field_expression "." (identifier) @function.method) "(")
60
61 (defined_resource_type
62 "define" . (identifier) @function)
63
64 ; Methods
65
66 (function_declaration
67 "function" . (class_identifier (identifier) @function.method .))
68
69 (function_call
70 (class_identifier (identifier) @function.method .))
71
72 (defined_resource_type
73 "define" . (class_identifier (identifier) @function.method .))
74
75 ; Types
76
77 (type) @type
78
79 (builtin_type) @type.builtin
80
81 (class_definition
82 (identifier) @type)
83 (class_definition
84 (class_identifier (identifier) @type .))
85
86 (class_inherits (identifier) @type)
87 (class_inherits (class_identifier (identifier) @type .))
88
89 (resource_declaration
90 (identifier) @type)
91 (resource_declaration
92 (class_identifier (identifier) @type .))
93
94 (node_definition (node_name (identifier) @type))
95
96 ((identifier) @type
97 (#match? @type "^[A-Z]"))
98
99 ((identifier) @type.builtin
100 (#any-of? @type.builtin "Boolean" "Integer" "Float" "String" "Array" "Hash" "Regexp" "Variant" "Data" "Undef" "Default" "File"))
101
102 ; "Namespaces"
103
104 (class_identifier . (identifier) @namespace)
105
106 ; Operators
107
108 [
109 "or"
110 "and"
111 "in"
112 ] @keyword.operator
113
114 [
115 "="
116 "+="
117 "->"
118 "~>"
119 "<<|"
120 "<|"
121 "|>"
122 "|>>"
123 "?"
124 ">"
125 ">="
126 "<="
127 "<"
128 "=="
129 "!="
130 "<<"
131 ">>"
132 "+"
133 "-"
134 "*"
135 "/"
136 "%"
137 "=~"
138 "!~"
139 ] @operator
140
141 ; Punctuation
142
143 [
144 "|"
145 "."
146 ","
147 ";"
148 ":"
149 "::"
150 "=>"
151 ] @punctuation.delimiter
152
153 [ "{" "}" ] @punctuation.bracket
154
155 [ "[" "]" ] @punctuation.bracket
156
157 [ "(" ")" ] @punctuation.bracket
158
159 (interpolation [ "${" "}" ] @punctuation.special) @none
160
161 [
162 "$"
163 "@"
164 "@@"
165 ] @punctuation.special
166
167 ; Literals
168
169 (number) @constant.numeric.integer
170
171 (float) @constant.numeric.float
172
173 (string) @string
174
175 (escape_sequence) @constant.character.escape
176
177 (regex) @string.regexp
178
179 (boolean) @constant.builtin.boolean
180
181 [
182 (undef)
183 (default)
184 ] @constant.builtin
185
186 ; Comments
187
188 (comment) @comment