Debian Codegraph @

runtime/queries/crystal/highlights.scm

raw symbols SCIP
1 [
2 ","
3 ";"
4 "."
5 ":"
6 "*"
7 "**"
8 ] @punctuation.delimiter
9
10 [
11 "alias"
12 "alignof"
13 "annotation"
14 "asm"
15 "begin"
16 "case"
17 "def"
18 "do"
19 "end"
20 "extend"
21 "forall"
22 "fun"
23 "in"
24 "include"
25 "instance_alignof"
26 "instance_sizeof"
27 "macro"
28 "of"
29 "offsetof"
30 "out"
31 "pointerof"
32 "select"
33 "sizeof"
34 "then"
35 "type"
36 "typeof"
37 "uninitialized"
38 "verbatim"
39 "when"
40 "with"
41 ] @keyword
42
43 [
44 "else"
45 "elsif"
46 "if"
47 "unless"
48 ] @keyword.control.conditional
49
50 [
51 "for"
52 "until"
53 "while"
54 ] @keyword.control.repeat
55
56 ["require"] @keyword.control.import
57
58 [
59 "break"
60 "next"
61 "return"
62 "yield"
63 ] @keyword.control.return
64
65 [
66 "ensure"
67 "rescue"
68 ] @keyword.control.exception
69
70 [
71 "class"
72 "enum"
73 "lib"
74 "module"
75 "struct"
76 "union"
77 ] @keyword.storage.type
78
79 (conditional
80 [
81 "?"
82 ":"
83 ] @keyword.control.conditional)
84
85 [
86 (private)
87 (protected)
88 "abstract"
89 ] @keyword
90
91 (pseudo_constant) @constant.builtin
92
93 ; literals
94 (char
95 ["'" (literal_content)] @string)
96
97 (char
98 (escape_sequence) @constant.character.escape)
99
100 (string
101 ["\"" (literal_content)] @string)
102
103 (string
104 (escape_sequence) @constant.character.escape)
105
106 (symbol
107 [
108 ":"
109 ":\""
110 "\""
111 (literal_content)
112 ] @string.special.symbol)
113
114 (symbol
115 (escape_sequence) @constant.character.escape)
116
117 (command
118 ["`" (literal_content)] @string.special)
119
120 (command
121 (escape_sequence) @constant.character.escape)
122
123 (regex
124 "/" @punctuation.bracket)
125
126 (regex
127 (literal_content) @string.regexp)
128
129 (regex_modifier) @string.special.symbol
130
131 (heredoc_body
132 (literal_content) @string)
133
134 (heredoc_body
135 (escape_sequence) @constant.character.escape)
136
137 [
138 (heredoc_start)
139 (heredoc_end)
140 ] @string.symbol
141
142 (integer) @constant.numeric.integer
143 (float) @constant.numeric.float
144
145 [
146 (true)
147 (false)
148 ] @constant.builtin.boolean
149
150 (nil) @constant.builtin
151
152 (self) @variable.builtin
153
154 (
155 (comment)+ @comment.block.documentation
156 .
157 [
158 (class_def)
159 (struct_def)
160 (method_def)
161 (abstract_method_def)
162 (macro_def)
163 (module_def)
164 (enum_def)
165 (annotation_def)
166 (lib_def)
167 (type_def)
168 (c_struct_def)
169 (union_def)
170 (alias)
171 (const_assign)
172 ]
173 )
174
175 (comment) @comment
176
177 ; Operators and punctuation
178 [
179 "="
180 "=>"
181 "->"
182 "&"
183 (operator)
184 ] @operator
185
186 [
187 "("
188 ")"
189 "["
190 "@["
191 "]"
192 "{"
193 "}"
194 ] @punctuation.bracket
195
196 (index_call
197 method: (operator) @punctuation.bracket
198 [
199 "]"
200 "]?"
201 ] @punctuation.bracket)
202
203 (block
204 "|" @punctuation.bracket)
205
206 [
207 "{%"
208 "%}"
209 "{{"
210 "}}"
211 ] @keyword.directive
212
213 (interpolation
214 "#{" @punctuation.special
215 "}" @punctuation.special)
216
217 ; TODO: {splat,double_splat,block,fun}_param + rescue param
218
219 ; Types
220
221 (nilable_constant
222 "?" @type)
223
224 (nilable_type
225 "?" @type)
226
227 (union_type
228 "|" @operator)
229
230 (annotation
231 (constant) @attribute)
232
233 (identifier) @variable
234 (param name: (identifier) @variable.parameter)
235
236 (method_def
237 name: (identifier) @function.method)
238
239 (macro_def
240 name: (identifier) @function.method)
241
242 (abstract_method_def
243 name: (identifier) @function.method)
244
245 (fun_def
246 name: (identifier) @function.method
247 real_name: (identifier)? @function.method)
248
249 (macro_var) @variable
250
251 [
252 (class_var)
253 (instance_var)
254 ] @variable.other.member
255
256 (named_expr
257 name: (identifier) @variable.other.member
258 ":" @variable.other.member)
259
260 (named_type
261 name: (identifier) @variable.other.member)
262
263 (underscore) @variable.special
264
265 ; function calls
266
267 (call
268 method: (_) @keyword
269 arguments: (argument_list
270 [
271 (type_declaration
272 var: (_) @function.method)
273 (assign
274 lhs: (_) @function.method)
275 (_) @function.method
276 ])
277 (#match? @keyword "^(class_)?(getter|setter|property)[?!]?$"))
278
279 (call
280 method: (_) @keyword
281 (#match? @keyword "^(record|is_a\\?|as|as\\?|responds_to\\?|nil\\?|\\!)$"))
282
283 (call
284 method: (_) @function.method)
285
286 (implicit_object_call
287 method: (_) @function.method)
288
289 (method_proc
290 method: (_) @function.method)
291
292 (assign_call
293 method: (_) @function.method)
294
295 ((identifier) @variable.builtin
296 (#match? @variable.builtin "^(previous_def|super)$"))
297
298 [
299 (constant)
300 (generic_instance_type)
301 (generic_type)
302 ] @type