Elffuss BraidHub

kikocis/continue public

main · 13.9 KiBRawPermalink
1{
2 "name": "F#",
3 "scopeName": "source.fsharp",
4 "fileTypes": ["fs"],
5 "foldingStartMarker": "",
6 "foldingStopMarker": "",
7 "patterns": [
8 {
9 "include": "#comments"
10 },
11 {
12 "include": "#constants"
13 },
14 {
15 "include": "#structure"
16 },
17 {
18 "include": "#attributes"
19 },
20 {
21 "include": "#strings"
22 },
23 {
24 "include": "#chars"
25 },
26 {
27 "include": "#double_tick"
28 },
29 {
30 "include": "#definition"
31 },
32 {
33 "include": "#method_calls"
34 },
35 {
36 "include": "#modules"
37 },
38 {
39 "include": "#anonymous_functions"
40 },
41 {
42 "include": "#keywords"
43 },
44 {
45 "include": "#records"
46 },
47 {
48 "include": "#cexprs"
49 },
50 {
51 "include": "#text"
52 }
53 ],
54 "repository": {
55 "anonymous_functions": {
56 "patterns": [
57 {
58 "name": "meta.function.anonymous",
59 "begin": "\\b(fun)\\b",
60 "end": "(->)",
61 "beginCaptures": {
62 "1": {
63 "name": "keyword.other.function-definition.fsharp"
64 }
65 },
66 "endCaptures": {
67 "1": {
68 "name": "keyword.other.fsharp"
69 }
70 },
71 "patterns": [
72 {
73 "include": "#variables"
74 }
75 ]
76 }
77 ]
78 },
79 "attributes": {
80 "patterns": [
81 {
82 "name": "support.function.attribute.fsharp",
83 "begin": "\\[\\<",
84 "end": "\\>\\]",
85 "patterns": [
86 {
87 "include": "$self"
88 }
89 ]
90 }
91 ]
92 },
93 "comments": {
94 "patterns": [
95 {
96 "name": "comment.block.fsharp",
97 "begin": "(\\(\\*(?!\\)))",
98 "end": "(\\*\\))",
99 "beginCaptures": {
100 "1": {
101 "name": "comment.block.fsharp"
102 }
103 },
104 "endCaptures": {
105 "1": {
106 "name": "comment.block.fsharp"
107 }
108 }
109 },
110 {
111 "name": "comment.line.double-slash.fsharp",
112 "match": "//.*$"
113 }
114 ]
115 },
116 "constants": {
117 "patterns": [
118 {
119 "name": "constant.language.unit.fsharp",
120 "match": "\\(\\)"
121 },
122 {
123 "name": "constant.numeric.floating-point.fsharp",
124 "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))"
125 },
126 {
127 "name": "constant.numeric.integer.nativeint.fsharp",
128 "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))"
129 },
130 {
131 "name": "constant.others.fsharp",
132 "match": "\\b(true|false|null|unit)\\b"
133 }
134 ]
135 },
136 "definition": {
137 "patterns": [
138 {
139 "name": "meta.binding.fsharp",
140 "begin": "(val mutable|val|let mutable|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+private|internal|public)?\\s+(\\([^\\s-]*\\)|[_a-zA-Z]([_a-zA-Z0-9,\\.]|(?<=,)\\s)*)",
141 "end": "((``.*``)|(with)|=|$)",
142 "beginCaptures": {
143 "1": {
144 "name": "keyword.other.binding.fsharp"
145 },
146 "2": {
147 "name": "keyword.other.function-recursive.fsharp"
148 },
149 "3": {
150 "name": "keyword.other.access.fsharp"
151 },
152 "4": {
153 "name": "variable.other.binding.fsharp"
154 }
155 },
156 "endCaptures": {
157 "1": {
158 "name": "keyword.other.fsharp"
159 },
160 "2": {
161 "name": "variable.other.binding.fsharp"
162 },
163 "3": {
164 "name": "keyword.other.fsharp"
165 }
166 },
167 "patterns": [
168 {
169 "include": "#variables"
170 }
171 ]
172 }
173 ]
174 },
175 "keywords": {
176 "patterns": [
177 {
178 "name": "keyword.other.fsharp",
179 "match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|member|try|finally|and|when|use|use\\!)\\b"
180 },
181 {
182 "name": "meta.preprocessor.fsharp",
183 "begin": "^\\s*#\\s*(light)\\b",
184 "end": "(\\s|$)"
185 },
186 {
187 "name": "keyword.other.fsharp",
188 "match": "(\\|>|\\->|\\<\\-|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|{|}|\\||_|\\.\\.|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\<\\<)"
189 }
190 ]
191 },
192 "modules": {
193 "patterns": [
194 {
195 "name": "entity.name.section.fsharp",
196 "begin": "\\b(namespace|module)(\\s+public|internal|private)?\\s+([a-zA-Z][a-zA-Z0-9'_. ]*)",
197 "end": "(\\s|$)",
198 "beginCaptures": {
199 "1": {
200 "name": "keyword.other.fsharp"
201 },
202 "2": {
203 "name": "keyword.other.fsharp"
204 },
205 "3": {
206 "name": "entity.name.section.fsharp"
207 }
208 },
209 "patterns": [
210 {
211 "name": "entity.name.section.fsharp",
212 "match": "(\\.)([A-Z][a-zA-Z0-9'_]*)",
213 "captures": {
214 "1": {
215 "name": "punctuation.separator.namespace-reference.fsharp"
216 },
217 "2": {
218 "name": "entity.name.section.fsharp"
219 }
220 }
221 }
222 ]
223 },
224 {
225 "name": "meta.namespace.open.fsharp",
226 "begin": "\\b(open)\\s+([A-Z][a-zA-Z0-9'_]*)(?=(\\.[A-Z][a-zA-Z0-9_]*)*)",
227 "end": "(\\s|$)",
228 "beginCaptures": {
229 "1": {
230 "name": "keyword.other.fsharp"
231 },
232 "2": {
233 "name": "entity.name.section.fsharp"
234 }
235 },
236 "patterns": [
237 {
238 "name": "entity.name.section.fsharp",
239 "match": "(\\.)([a-zA-Z][a-zA-Z0-9'_]*)",
240 "captures": {
241 "1": {
242 "name": "punctuation.separator.namespace-reference.fsharp"
243 },
244 "2": {
245 "name": "entity.name.section.fsharp"
246 }
247 }
248 }
249 ]
250 },
251 {
252 "name": "meta.namespace.alias.fsharp",
253 "begin": "^\\s*(module)\\s+([A-Z][a-zA-Z0-9'_]*)\\s*(=)\\s*([A-Z][a-zA-Z0-9'_]*)",
254 "end": "(\\s|$)",
255 "beginCaptures": {
256 "1": {
257 "name": "keyword.other.namespace-definition.fsharp"
258 },
259 "2": {
260 "name": "entity.name.type.namespace.fsharp"
261 },
262 "3": {
263 "name": "punctuation.separator.namespace-definition.fsharp"
264 },
265 "4": {
266 "name": "entity.name.section.fsharp"
267 }
268 },
269 "patterns": [
270 {
271 "name": "entity.name.section.fsharp",
272 "match": "(\\.)([A-Z][a-zA-Z0-9'_]*)",
273 "captures": {
274 "1": {
275 "name": "punctuation.separator.namespace-reference.fsharp"
276 },
277 "2": {
278 "name": "entity.name.section.fsharp"
279 }
280 }
281 }
282 ]
283 }
284 ]
285 },
286 "strings": {
287 "patterns": [
288 {
289 "contentName": "string.quoted.literalprintf.fsharp",
290 "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(@\"))",
291 "end": "(\")",
292 "beginCaptures": {
293 "2": {
294 "name": "punctuation.definition.string.begin.fsharp"
295 }
296 },
297 "endCaptures": {
298 "1": {
299 "name": "punctuation.definition.string.end.fsharp"
300 }
301 },
302 "patterns": [
303 {
304 "name": "constant.character.string.escape.fsharp",
305 "match": "\"(\")"
306 },
307 {
308 "name": "constant.character.string.escape.format.fsharp",
309 "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)"
310 }
311 ]
312 },
313 {
314 "name": "string.quoted.literal.fsharp",
315 "begin": "(?=[^\\\\])(@\")",
316 "end": "(\")",
317 "beginCaptures": {
318 "1": {
319 "name": "punctuation.definition.string.begin.fsharp"
320 }
321 },
322 "endCaptures": {
323 "1": {
324 "name": "punctuation.definition.string.end.fsharp"
325 }
326 },
327 "patterns": [
328 {
329 "name": "constant.character.string.escape.fsharp",
330 "match": "\"(\")"
331 }
332 ]
333 },
334 {
335 "contentName": "string.quoted.tripleprintf.fsharp",
336 "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(\"\"\"))",
337 "end": "(\"\"\")",
338 "beginCaptures": {
339 "2": {
340 "name": "punctuation.definition.string.begin.fsharp"
341 }
342 },
343 "endCaptures": {
344 "1": {
345 "name": "punctuation.definition.string.end.fsharp"
346 }
347 },
348 "patterns": [
349 {
350 "name": "constant.character.string.escape.format.fsharp",
351 "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)"
352 }
353 ]
354 },
355 {
356 "name": "string.quoted.triple.fsharp",
357 "begin": "(?=[^\\\\])(\"\"\")",
358 "end": "(\"\"\")",
359 "beginCaptures": {
360 "1": {
361 "name": "punctuation.definition.string.begin.fsharp"
362 }
363 },
364 "endCaptures": {
365 "1": {
366 "name": "punctuation.definition.string.end.fsharp"
367 }
368 }
369 },
370 {
371 "contentName": "string.quoted.doubleprintf.fsharp",
372 "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(\"))",
373 "end": "(\")",
374 "beginCaptures": {
375 "2": {
376 "name": "punctuation.definition.string.begin.fsharp"
377 }
378 },
379 "endCaptures": {
380 "1": {
381 "name": "punctuation.definition.string.end.fsharp"
382 }
383 },
384 "patterns": [
385 {
386 "name": "punctuation.separator.string.ignore-eol.fsharp",
387 "match": "\\\\$[ \\t]*"
388 },
389 {
390 "name": "constant.character.string.escape.format.fsharp",
391 "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)"
392 },
393 {
394 "name": "constant.character.string.escape.fsharp",
395 "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})"
396 },
397 {
398 "name": "invalid.illeagal.character.string.fsharp",
399 "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})."
400 }
401 ]
402 },
403
404 {
405 "name": "string.quoted.double.fsharp",
406 "begin": "(?=[^\\\\])(\")",
407 "end": "(\")",
408 "beginCaptures": {
409 "1": {
410 "name": "punctuation.definition.string.begin.fsharp"
411 }
412 },
413 "endCaptures": {
414 "1": {
415 "name": "punctuation.definition.string.end.fsharp"
416 }
417 },
418 "patterns": [
419 {
420 "name": "punctuation.separator.string.ignore-eol.fsharp",
421 "match": "\\\\$[ \\t]*"
422 },
423 {
424 "name": "constant.character.string.escape.fsharp",
425 "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})"
426 },
427 {
428 "name": "invalid.illeagal.character.string.fsharp",
429 "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})."
430 }
431 ]
432 }
433 ]
434 },
435 "variables": {
436 "patterns": [
437 {
438 "name": "constant.language.unit.fsharp",
439 "match": "\\(\\)"
440 },
441 {
442 "name": "variable.parameter.fsharp",
443 "match": "[a-zA-Z']\\w*"
444 }
445 ]
446 },
447 "double_tick": {
448 "patterns": [
449 {
450 "name": "variable.other.binding.fsharp",
451 "match": "(``)(.*)(``)",
452 "captures": {
453 "1": {
454 "name": "string.quoted.single.fsharp"
455 },
456 "1": {
457 "name": "variable.other.binding.fsharp"
458 },
459 "3": {
460 "name": "string.quoted.single.fsharp"
461 }
462 }
463 }
464 ]
465 },
466 "records": {
467 "patterns": [
468 {
469 "name": "record.fsharp",
470 "match": "(type)[\\s]+(private|internal|public)?[\\s]*([a-zA-Z0-9'<>^:,. ]+)((with)|(=)|(\\(\\)))",
471
472 "captures": {
473 "1": {
474 "name": "keyword.other.fsharp"
475 },
476 "2": {
477 "name": "keyword.other.fsharp"
478 },
479 "3": {
480 "name": "entity.name.type.fsharp"
481 },
482 "5": {
483 "name": "keyword.other.fsharp"
484 },
485 "6": {
486 "name": "keyword.other.fsharp"
487 },
488 "7": {
489 "name": "constant.language.unit.fsharp"
490 }
491 }
492 }
493 ]
494 },
495 "cexprs": {
496 "patterns": [
497 {
498 "name": "cexpr.fsharp",
499 "match": "\\b([a-zA-Z]*\\s+\\{)",
500 "captures": {
501 "1": {
502 "name": "keyword.other.fsharp"
503 }
504 }
505 }
506 ]
507 },
508 "chars": {
509 "patterns": [
510 {
511 "name": "char.fsharp",
512 "match": "('\\\\?.')",
513 "captures": {
514 "1": {
515 "name": "string.quoted.single.fsharp"
516 }
517 }
518 }
519 ]
520 },
521 "text": {
522 "patterns": [
523 {
524 "name": "text.fsharp",
525 "match": "\\\\"
526 }
527 ]
528 }
529 }
530}