Debian Codegraph @

runtime/queries/fsharp/highlights.scm

raw symbols SCIP
1 ;; ----------------------------------------------------------------------------
2 ;; Literals and comments
3
4 (line_comment) @comment.line
5
6 (block_comment) @comment.block
7
8 (xml_doc) @comment.block.documentation
9
10 (const
11 [
12 (_) @constant
13 (unit) @constant.builtin
14 ])
15
16 (primary_constr_args (_) @variable.parameter)
17
18 ((identifier_pattern (long_identifier_or_op (identifier) @special))
19 (#match? @special "^\_.*"))
20
21 ((long_identifier
22 (identifier)+
23 .
24 (identifier) @variable.other.member))
25
26 ;; ----------------------------------------------------------------------------
27 ;; Punctuation
28
29 (wildcard_pattern) @string.special
30
31 (type_name type_name: (_) @type)
32
33 ; The generic `type` node was split into concrete type nodes; colour named
34 ; type references (simple_type) and the head of a generic application.
35 [
36 (simple_type)
37 (atomic_type)
38 ] @type
39 (generic_type (long_identifier) @type)
40
41 (member_signature
42 .
43 (identifier) @function.method
44 (curried_spec
45 (arguments_spec
46 "*"* @operator
47 (argument_spec
48 (argument_name_spec
49 "?"? @special
50 name: (_) @variable.parameter)))))
51
52 (union_type_case) @constant
53
54 (rules
55 (rule
56 pattern: (_) @constant
57 block: (_)))
58
59 (identifier_pattern
60 .
61 (_) @constant
62 .
63 (_) @variable)
64
65 (fsi_directive_decl . (string) @namespace)
66
67 (import_decl . (_) @namespace)
68 (named_module
69 name: (_) @namespace)
70 (namespace
71 name: (_) @namespace)
72 (module_defn
73 .
74 (_) @namespace)
75
76 (ce_expression
77 .
78 (_) @function.macro)
79
80 (field_initializer
81 field: (_) @variable.other.member)
82
83 (record_fields
84 (record_field
85 .
86 (identifier) @variable.other.member))
87
88 (dot_expression
89 base: (_) @namespace
90 field: (_) @variable.other.member)
91
92 (value_declaration_left . (_) @variable)
93
94 (function_declaration_left
95 . (_) @function
96 [
97 (argument_patterns)
98 (argument_patterns (long_identifier (identifier)))
99 ] @variable.parameter)
100
101 (member_defn
102 (method_or_prop_defn
103 [
104 (property_or_ident) @function
105 (property_or_ident
106 instance: (identifier) @variable.builtin
107 method: (identifier) @function.method)
108 ]
109 args: (_)* @variable.parameter))
110
111 (application_expression
112 .
113 [
114 (long_identifier_or_op [
115 (long_identifier (identifier)* (identifier) @function)
116 (identifier) @function
117 ])
118 (typed_expression . (long_identifier_or_op (long_identifier (identifier)* . (identifier) @function)))
119 (dot_expression base: (_) @variable.other.member field: (_) @function)
120 ] @function)
121
122 ((infix_expression
123 .
124 (_)
125 .
126 (infix_op) @operator
127 .
128 (_) @function
129 )
130 (#eq? @operator "|>")
131 )
132
133 ((infix_expression
134 .
135 (_) @function
136 .
137 (infix_op) @operator
138 .
139 (_)
140 )
141 (#eq? @operator "<|")
142 )
143
144 [
145 (xint)
146 (int)
147 (int16)
148 (uint16)
149 (int32)
150 (uint32)
151 (int64)
152 (uint64)
153 (nativeint)
154 (unativeint)
155 ] @constant.numeric.integer
156
157 [
158 (ieee32)
159 (ieee64)
160 (float)
161 (decimal)
162 ] @constant.numeric.float
163
164 (bool) @constant.builtin.boolean
165
166 ([
167 (string)
168 (triple_quoted_string)
169 (verbatim_string)
170 (char)
171 ] @string)
172
173 (compiler_directive_decl) @keyword.directive
174
175 (attribute) @attribute
176
177 [
178 "("
179 ")"
180 "{"
181 "}"
182 "["
183 "]"
184 "[|"
185 "|]"
186 "{|"
187 "|}"
188 "[<"
189 ">]"
190 ] @punctuation.bracket
191
192 (format_string_eval
193 [
194 "{"
195 "}"
196 ] @punctuation.special)
197
198 [
199 ","
200 ";"
201 ] @punctuation.delimiter
202
203 [
204 "|"
205 "="
206 ">"
207 "<"
208 "-"
209 "~"
210 "->"
211 "<-"
212 "&&"
213 "||"
214 ":>"
215 ":?>"
216 (infix_op)
217 (prefix_op)
218 ] @operator
219
220 [
221 "if"
222 "then"
223 "else"
224 "elif"
225 "when"
226 "match"
227 "match!"
228 ] @keyword.control.conditional
229
230 [
231 "and"
232 "or"
233 "not"
234 "upcast"
235 "downcast"
236 ] @keyword.operator
237
238 [
239 "return"
240 "return!"
241 "yield"
242 "yield!"
243 ] @keyword.control.return
244
245 [
246 "for"
247 "while"
248 "downto"
249 "to"
250 ] @keyword.control.repeat
251
252
253 [
254 "open"
255 "#r"
256 "#load"
257 ] @keyword.control.import
258
259 [
260 "abstract"
261 "delegate"
262 "static"
263 "inline"
264 "mutable"
265 "override"
266 "rec"
267 "global"
268 (access_modifier)
269 ] @keyword.storage.modifier
270
271 [
272 "let"
273 "let!"
274 "use"
275 "use!"
276 "member"
277 ] @keyword.function
278
279 [
280 "enum"
281 "type"
282 "inherit"
283 "interface"
284 ] @keyword.storage.type
285
286 (try_expression
287 [
288 "try"
289 "with"
290 "finally"
291 ] @keyword.control.exception)
292
293 ((identifier) @keyword.control.exception
294 (#any-of? @keyword.control.exception "failwith" "failwithf" "raise" "reraise"))
295
296 [
297 "as"
298 "assert"
299 "begin"
300 "end"
301 "done"
302 "default"
303 "in"
304 "do"
305 "do!"
306 "fun"
307 "function"
308 "get"
309 "set"
310 "lazy"
311 "new"
312 "of"
313 "struct"
314 "val"
315 "module"
316 "namespace"
317 "with"
318 ] @keyword
319
320 [
321 "null"
322 ] @constant.builtin
323
324 (match_expression "with" @keyword.control.conditional)
325
326 ((simple_type
327 (long_identifier (identifier) @type.builtin))
328 (#any-of? @type.builtin "bool" "byte" "sbyte" "int16" "uint16" "int" "uint" "int64" "uint64" "nativeint" "unativeint" "decimal" "float" "double" "float32" "single" "char" "string" "unit"))
329
330 (preproc_if
331 [
332 "#if" @keyword.directive
333 "#endif" @keyword.directive
334 ]
335 condition: (_)? @keyword.directive)
336
337 (preproc_else
338 "#else" @keyword.directive)
339
340 ((long_identifier
341 (identifier)+ @namespace
342 .
343 (identifier)))
344
345 (long_identifier_or_op
346 (op_identifier) @operator)
347
348 ((identifier) @namespace
349 (#any-of? @namespace "Array" "Async" "Directory" "File" "List" "Option" "Path" "Map" "Set" "Lazy" "Seq" "Task" "String" "Result" ))