Elffuss BraidHub

kikocis/continue public

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