Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/csharp/syntaxes/csharp.tmLanguage.json
5221 views
1
{
2
"information_for_contributors": [
3
"This file has been converted from https://github.com/dotnet/csharp-tmLanguage/blob/master/grammars/csharp.tmLanguage",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/2e6860d87d4019b0b793b1e21e9e5c82185a01aa",
8
"name": "C#",
9
"scopeName": "source.cs",
10
"patterns": [
11
{
12
"include": "#preprocessor"
13
},
14
{
15
"include": "#comment"
16
},
17
{
18
"include": "#directives"
19
},
20
{
21
"include": "#declarations"
22
},
23
{
24
"include": "#script-top-level"
25
}
26
],
27
"repository": {
28
"directives": {
29
"patterns": [
30
{
31
"include": "#extern-alias-directive"
32
},
33
{
34
"include": "#using-directive"
35
},
36
{
37
"include": "#attribute-section"
38
},
39
{
40
"include": "#punctuation-semicolon"
41
}
42
]
43
},
44
"declarations": {
45
"patterns": [
46
{
47
"include": "#namespace-declaration"
48
},
49
{
50
"include": "#type-declarations"
51
},
52
{
53
"include": "#punctuation-semicolon"
54
}
55
]
56
},
57
"script-top-level": {
58
"patterns": [
59
{
60
"include": "#statement"
61
},
62
{
63
"include": "#method-declaration"
64
},
65
{
66
"include": "#punctuation-semicolon"
67
}
68
]
69
},
70
"type-declarations": {
71
"patterns": [
72
{
73
"include": "#preprocessor"
74
},
75
{
76
"include": "#comment"
77
},
78
{
79
"include": "#storage-modifier"
80
},
81
{
82
"include": "#class-declaration"
83
},
84
{
85
"include": "#delegate-declaration"
86
},
87
{
88
"include": "#enum-declaration"
89
},
90
{
91
"include": "#interface-declaration"
92
},
93
{
94
"include": "#struct-declaration"
95
},
96
{
97
"include": "#record-declaration"
98
},
99
{
100
"include": "#attribute-section"
101
},
102
{
103
"include": "#punctuation-semicolon"
104
}
105
]
106
},
107
"class-or-struct-members": {
108
"patterns": [
109
{
110
"include": "#preprocessor"
111
},
112
{
113
"include": "#comment"
114
},
115
{
116
"include": "#storage-modifier"
117
},
118
{
119
"include": "#type-declarations"
120
},
121
{
122
"include": "#constructor-declaration"
123
},
124
{
125
"include": "#property-declaration"
126
},
127
{
128
"include": "#fixed-size-buffer-declaration"
129
},
130
{
131
"include": "#field-declaration"
132
},
133
{
134
"include": "#event-declaration"
135
},
136
{
137
"include": "#indexer-declaration"
138
},
139
{
140
"include": "#variable-initializer"
141
},
142
{
143
"include": "#destructor-declaration"
144
},
145
{
146
"include": "#operator-declaration"
147
},
148
{
149
"include": "#conversion-operator-declaration"
150
},
151
{
152
"include": "#method-declaration"
153
},
154
{
155
"include": "#attribute-section"
156
},
157
{
158
"include": "#punctuation-semicolon"
159
}
160
]
161
},
162
"interface-members": {
163
"patterns": [
164
{
165
"include": "#preprocessor"
166
},
167
{
168
"include": "#comment"
169
},
170
{
171
"include": "#storage-modifier"
172
},
173
{
174
"include": "#property-declaration"
175
},
176
{
177
"include": "#event-declaration"
178
},
179
{
180
"include": "#indexer-declaration"
181
},
182
{
183
"include": "#method-declaration"
184
},
185
{
186
"include": "#operator-declaration"
187
},
188
{
189
"include": "#attribute-section"
190
},
191
{
192
"include": "#punctuation-semicolon"
193
}
194
]
195
},
196
"statement": {
197
"patterns": [
198
{
199
"include": "#preprocessor"
200
},
201
{
202
"include": "#comment"
203
},
204
{
205
"include": "#while-statement"
206
},
207
{
208
"include": "#do-statement"
209
},
210
{
211
"include": "#for-statement"
212
},
213
{
214
"include": "#foreach-statement"
215
},
216
{
217
"include": "#if-statement"
218
},
219
{
220
"include": "#else-part"
221
},
222
{
223
"include": "#goto-statement"
224
},
225
{
226
"include": "#return-statement"
227
},
228
{
229
"include": "#break-or-continue-statement"
230
},
231
{
232
"include": "#throw-statement"
233
},
234
{
235
"include": "#yield-statement"
236
},
237
{
238
"include": "#await-statement"
239
},
240
{
241
"include": "#try-statement"
242
},
243
{
244
"include": "#expression-operator-expression"
245
},
246
{
247
"include": "#context-control-statement"
248
},
249
{
250
"include": "#context-control-paren-statement"
251
},
252
{
253
"include": "#labeled-statement"
254
},
255
{
256
"include": "#object-creation-expression"
257
},
258
{
259
"include": "#array-creation-expression"
260
},
261
{
262
"include": "#anonymous-object-creation-expression"
263
},
264
{
265
"include": "#local-declaration"
266
},
267
{
268
"include": "#block"
269
},
270
{
271
"include": "#expression"
272
},
273
{
274
"include": "#punctuation-semicolon"
275
}
276
]
277
},
278
"expression": {
279
"patterns": [
280
{
281
"include": "#preprocessor"
282
},
283
{
284
"include": "#comment"
285
},
286
{
287
"include": "#expression-operator-expression"
288
},
289
{
290
"include": "#type-operator-expression"
291
},
292
{
293
"include": "#default-literal-expression"
294
},
295
{
296
"include": "#throw-expression"
297
},
298
{
299
"include": "#raw-interpolated-string"
300
},
301
{
302
"include": "#interpolated-string"
303
},
304
{
305
"include": "#verbatim-interpolated-string"
306
},
307
{
308
"include": "#type-builtin"
309
},
310
{
311
"include": "#language-variable"
312
},
313
{
314
"include": "#switch-statement-or-expression"
315
},
316
{
317
"include": "#with-expression"
318
},
319
{
320
"include": "#conditional-operator"
321
},
322
{
323
"include": "#assignment-expression"
324
},
325
{
326
"include": "#expression-operators"
327
},
328
{
329
"include": "#await-expression"
330
},
331
{
332
"include": "#query-expression"
333
},
334
{
335
"include": "#as-expression"
336
},
337
{
338
"include": "#is-expression"
339
},
340
{
341
"include": "#boolean-literal"
342
},
343
{
344
"include": "#null-literal"
345
},
346
{
347
"include": "#anonymous-method-expression"
348
},
349
{
350
"include": "#object-creation-expression"
351
},
352
{
353
"include": "#array-creation-expression"
354
},
355
{
356
"include": "#anonymous-object-creation-expression"
357
},
358
{
359
"include": "#invocation-expression"
360
},
361
{
362
"include": "#member-access-expression"
363
},
364
{
365
"include": "#element-access-expression"
366
},
367
{
368
"include": "#cast-expression"
369
},
370
{
371
"include": "#literal"
372
},
373
{
374
"include": "#parenthesized-expression"
375
},
376
{
377
"include": "#tuple-deconstruction-assignment"
378
},
379
{
380
"include": "#initializer-expression"
381
},
382
{
383
"include": "#identifier"
384
}
385
]
386
},
387
"extern-alias-directive": {
388
"begin": "\\b(extern)\\s+(alias)\\b",
389
"beginCaptures": {
390
"1": {
391
"name": "keyword.other.directive.extern.cs"
392
},
393
"2": {
394
"name": "keyword.other.directive.alias.cs"
395
}
396
},
397
"end": "(?=;)",
398
"patterns": [
399
{
400
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
401
"name": "variable.other.alias.cs"
402
}
403
]
404
},
405
"using-directive": {
406
"patterns": [
407
{
408
"begin": "\\b(?:(global)\\s+)?(using)\\s+(static)\\b\\s*(?:(unsafe)\\b\\s*)?",
409
"beginCaptures": {
410
"1": {
411
"name": "keyword.other.directive.global.cs"
412
},
413
"2": {
414
"name": "keyword.other.directive.using.cs"
415
},
416
"3": {
417
"name": "keyword.other.directive.static.cs"
418
},
419
"4": {
420
"name": "storage.modifier.unsafe.cs"
421
}
422
},
423
"end": "(?=;)",
424
"patterns": [
425
{
426
"include": "#type"
427
}
428
]
429
},
430
{
431
"begin": "\\b(?:(global)\\s+)?(using)\\b\\s*(?:(unsafe)\\b\\s*)?(@?[_[:alpha:]][_[:alnum:]]*)\\s*(=)",
432
"beginCaptures": {
433
"1": {
434
"name": "keyword.other.directive.global.cs"
435
},
436
"2": {
437
"name": "keyword.other.directive.using.cs"
438
},
439
"3": {
440
"name": "storage.modifier.unsafe.cs"
441
},
442
"4": {
443
"name": "entity.name.type.alias.cs"
444
},
445
"5": {
446
"name": "keyword.operator.assignment.cs"
447
}
448
},
449
"end": "(?=;)",
450
"patterns": [
451
{
452
"include": "#comment"
453
},
454
{
455
"include": "#type"
456
}
457
]
458
},
459
{
460
"begin": "\\b(?:(global)\\s+)?(using)\\b\\s*+(?!\\(|var\\b)",
461
"beginCaptures": {
462
"1": {
463
"name": "keyword.other.directive.global.cs"
464
},
465
"2": {
466
"name": "keyword.other.directive.using.cs"
467
}
468
},
469
"end": "(?=;)",
470
"patterns": [
471
{
472
"include": "#comment"
473
},
474
{
475
"name": "entity.name.type.namespace.cs",
476
"match": "\\@?[_[:alpha:]][_[:alnum:]]*"
477
},
478
{
479
"include": "#punctuation-accessor"
480
},
481
{
482
"include": "#operator-assignment"
483
}
484
]
485
}
486
]
487
},
488
"attribute-section": {
489
"begin": "(\\[)(assembly|module|field|event|method|param|property|return|typevar|type)?(\\:)?",
490
"beginCaptures": {
491
"1": {
492
"name": "punctuation.squarebracket.open.cs"
493
},
494
"2": {
495
"name": "keyword.other.attribute-specifier.cs"
496
},
497
"3": {
498
"name": "punctuation.separator.colon.cs"
499
}
500
},
501
"end": "(\\])",
502
"endCaptures": {
503
"1": {
504
"name": "punctuation.squarebracket.close.cs"
505
}
506
},
507
"patterns": [
508
{
509
"include": "#comment"
510
},
511
{
512
"include": "#attribute"
513
},
514
{
515
"include": "#punctuation-comma"
516
}
517
]
518
},
519
"attribute": {
520
"patterns": [
521
{
522
"include": "#type-name"
523
},
524
{
525
"include": "#type-arguments"
526
},
527
{
528
"include": "#attribute-arguments"
529
}
530
]
531
},
532
"attribute-arguments": {
533
"begin": "(\\()",
534
"beginCaptures": {
535
"1": {
536
"name": "punctuation.parenthesis.open.cs"
537
}
538
},
539
"end": "(\\))",
540
"endCaptures": {
541
"1": {
542
"name": "punctuation.parenthesis.close.cs"
543
}
544
},
545
"patterns": [
546
{
547
"include": "#attribute-named-argument"
548
},
549
{
550
"include": "#expression"
551
},
552
{
553
"include": "#punctuation-comma"
554
}
555
]
556
},
557
"attribute-named-argument": {
558
"begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?==)",
559
"beginCaptures": {
560
"1": {
561
"name": "entity.name.variable.property.cs"
562
}
563
},
564
"end": "(?=(,|\\)))",
565
"patterns": [
566
{
567
"include": "#operator-assignment"
568
},
569
{
570
"include": "#expression"
571
}
572
]
573
},
574
"namespace-declaration": {
575
"begin": "\\b(namespace)\\s+",
576
"beginCaptures": {
577
"1": {
578
"name": "storage.type.namespace.cs"
579
}
580
},
581
"end": "(?<=\\})|(?=;)",
582
"patterns": [
583
{
584
"include": "#comment"
585
},
586
{
587
"name": "entity.name.type.namespace.cs",
588
"match": "@?[_[:alpha:]][_[:alnum:]]*"
589
},
590
{
591
"include": "#punctuation-accessor"
592
},
593
{
594
"begin": "\\{",
595
"beginCaptures": {
596
"0": {
597
"name": "punctuation.curlybrace.open.cs"
598
}
599
},
600
"end": "\\}",
601
"endCaptures": {
602
"0": {
603
"name": "punctuation.curlybrace.close.cs"
604
}
605
},
606
"patterns": [
607
{
608
"include": "#declarations"
609
},
610
{
611
"include": "#using-directive"
612
},
613
{
614
"include": "#punctuation-semicolon"
615
}
616
]
617
}
618
]
619
},
620
"storage-modifier": {
621
"name": "storage.modifier.$1.cs",
622
"match": "(?<!\\.)\\b(new|public|protected|internal|private|abstract|virtual|override|sealed|static|partial|readonly|volatile|const|extern|async|unsafe|ref|required|file)\\b"
623
},
624
"class-declaration": {
625
"begin": "(?=(\\brecord\\b\\s+)?\\bclass\\b)",
626
"end": "(?<=\\})|(?=;)",
627
"patterns": [
628
{
629
"begin": "(?x)\n(\\b(record)\\b\\s+)?\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*",
630
"beginCaptures": {
631
"2": {
632
"name": "storage.type.record.cs"
633
},
634
"3": {
635
"name": "storage.type.class.cs"
636
},
637
"4": {
638
"name": "entity.name.type.class.cs"
639
}
640
},
641
"end": "(?=\\{)|(?=;)",
642
"patterns": [
643
{
644
"include": "#comment"
645
},
646
{
647
"include": "#type-parameter-list"
648
},
649
{
650
"include": "#parenthesized-parameter-list"
651
},
652
{
653
"include": "#base-types"
654
},
655
{
656
"include": "#generic-constraints"
657
}
658
]
659
},
660
{
661
"begin": "\\{",
662
"beginCaptures": {
663
"0": {
664
"name": "punctuation.curlybrace.open.cs"
665
}
666
},
667
"end": "\\}",
668
"endCaptures": {
669
"0": {
670
"name": "punctuation.curlybrace.close.cs"
671
}
672
},
673
"patterns": [
674
{
675
"include": "#class-or-struct-members"
676
}
677
]
678
},
679
{
680
"include": "#preprocessor"
681
},
682
{
683
"include": "#comment"
684
}
685
]
686
},
687
"delegate-declaration": {
688
"begin": "(?x)\n(?:\\b(delegate)\\b)\\s+\n(?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()",
689
"beginCaptures": {
690
"1": {
691
"name": "storage.type.delegate.cs"
692
},
693
"2": {
694
"patterns": [
695
{
696
"include": "#type"
697
}
698
]
699
},
700
"7": {
701
"name": "entity.name.type.delegate.cs"
702
},
703
"8": {
704
"patterns": [
705
{
706
"include": "#type-parameter-list"
707
}
708
]
709
}
710
},
711
"end": "(?=;)",
712
"patterns": [
713
{
714
"include": "#comment"
715
},
716
{
717
"include": "#parenthesized-parameter-list"
718
},
719
{
720
"include": "#generic-constraints"
721
}
722
]
723
},
724
"enum-declaration": {
725
"begin": "(?=\\benum\\b)",
726
"end": "(?<=\\})|(?=;)",
727
"patterns": [
728
{
729
"begin": "(?=enum)",
730
"end": "(?=\\{)|(?=;)",
731
"patterns": [
732
{
733
"include": "#comment"
734
},
735
{
736
"match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)",
737
"captures": {
738
"1": {
739
"name": "storage.type.enum.cs"
740
},
741
"2": {
742
"name": "entity.name.type.enum.cs"
743
}
744
}
745
},
746
{
747
"begin": ":",
748
"beginCaptures": {
749
"0": {
750
"name": "punctuation.separator.colon.cs"
751
}
752
},
753
"end": "(?=\\{)",
754
"patterns": [
755
{
756
"include": "#type"
757
}
758
]
759
}
760
]
761
},
762
{
763
"begin": "\\{",
764
"beginCaptures": {
765
"0": {
766
"name": "punctuation.curlybrace.open.cs"
767
}
768
},
769
"end": "\\}",
770
"endCaptures": {
771
"0": {
772
"name": "punctuation.curlybrace.close.cs"
773
}
774
},
775
"patterns": [
776
{
777
"include": "#preprocessor"
778
},
779
{
780
"include": "#comment"
781
},
782
{
783
"include": "#attribute-section"
784
},
785
{
786
"include": "#punctuation-comma"
787
},
788
{
789
"begin": "@?[_[:alpha:]][_[:alnum:]]*",
790
"beginCaptures": {
791
"0": {
792
"name": "entity.name.variable.enum-member.cs"
793
}
794
},
795
"end": "(?=(,|\\}))",
796
"patterns": [
797
{
798
"include": "#comment"
799
},
800
{
801
"include": "#variable-initializer"
802
}
803
]
804
}
805
]
806
},
807
{
808
"include": "#preprocessor"
809
},
810
{
811
"include": "#comment"
812
}
813
]
814
},
815
"interface-declaration": {
816
"begin": "(?=\\binterface\\b)",
817
"end": "(?<=\\})|(?=;)",
818
"patterns": [
819
{
820
"begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
821
"beginCaptures": {
822
"1": {
823
"name": "storage.type.interface.cs"
824
},
825
"2": {
826
"name": "entity.name.type.interface.cs"
827
}
828
},
829
"end": "(?=\\{)|(?=;)",
830
"patterns": [
831
{
832
"include": "#comment"
833
},
834
{
835
"include": "#type-parameter-list"
836
},
837
{
838
"include": "#base-types"
839
},
840
{
841
"include": "#generic-constraints"
842
}
843
]
844
},
845
{
846
"begin": "\\{",
847
"beginCaptures": {
848
"0": {
849
"name": "punctuation.curlybrace.open.cs"
850
}
851
},
852
"end": "\\}",
853
"endCaptures": {
854
"0": {
855
"name": "punctuation.curlybrace.close.cs"
856
}
857
},
858
"patterns": [
859
{
860
"include": "#interface-members"
861
}
862
]
863
},
864
{
865
"include": "#preprocessor"
866
},
867
{
868
"include": "#comment"
869
}
870
]
871
},
872
"record-declaration": {
873
"begin": "(?=\\brecord\\b)",
874
"end": "(?<=\\})|(?=;)",
875
"patterns": [
876
{
877
"begin": "(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
878
"beginCaptures": {
879
"1": {
880
"name": "storage.type.record.cs"
881
},
882
"2": {
883
"name": "entity.name.type.class.cs"
884
}
885
},
886
"end": "(?=\\{)|(?=;)",
887
"patterns": [
888
{
889
"include": "#comment"
890
},
891
{
892
"include": "#type-parameter-list"
893
},
894
{
895
"include": "#parenthesized-parameter-list"
896
},
897
{
898
"include": "#base-types"
899
},
900
{
901
"include": "#generic-constraints"
902
}
903
]
904
},
905
{
906
"begin": "\\{",
907
"beginCaptures": {
908
"0": {
909
"name": "punctuation.curlybrace.open.cs"
910
}
911
},
912
"end": "\\}",
913
"endCaptures": {
914
"0": {
915
"name": "punctuation.curlybrace.close.cs"
916
}
917
},
918
"patterns": [
919
{
920
"include": "#class-or-struct-members"
921
}
922
]
923
},
924
{
925
"include": "#preprocessor"
926
},
927
{
928
"include": "#comment"
929
}
930
]
931
},
932
"struct-declaration": {
933
"begin": "(?=(\\brecord\\b\\s+)?\\bstruct\\b)",
934
"end": "(?<=\\})|(?=;)",
935
"patterns": [
936
{
937
"begin": "(?x)\n(\\b(record)\\b\\s+)?\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
938
"beginCaptures": {
939
"2": {
940
"name": "storage.type.record.cs"
941
},
942
"3": {
943
"name": "storage.type.struct.cs"
944
},
945
"4": {
946
"name": "entity.name.type.struct.cs"
947
}
948
},
949
"end": "(?=\\{)|(?=;)",
950
"patterns": [
951
{
952
"include": "#comment"
953
},
954
{
955
"include": "#type-parameter-list"
956
},
957
{
958
"include": "#parenthesized-parameter-list"
959
},
960
{
961
"include": "#base-types"
962
},
963
{
964
"include": "#generic-constraints"
965
}
966
]
967
},
968
{
969
"begin": "\\{",
970
"beginCaptures": {
971
"0": {
972
"name": "punctuation.curlybrace.open.cs"
973
}
974
},
975
"end": "\\}",
976
"endCaptures": {
977
"0": {
978
"name": "punctuation.curlybrace.close.cs"
979
}
980
},
981
"patterns": [
982
{
983
"include": "#class-or-struct-members"
984
}
985
]
986
},
987
{
988
"include": "#preprocessor"
989
},
990
{
991
"include": "#comment"
992
}
993
]
994
},
995
"type-parameter-list": {
996
"begin": "\\<",
997
"beginCaptures": {
998
"0": {
999
"name": "punctuation.definition.typeparameters.begin.cs"
1000
}
1001
},
1002
"end": "\\>",
1003
"endCaptures": {
1004
"0": {
1005
"name": "punctuation.definition.typeparameters.end.cs"
1006
}
1007
},
1008
"patterns": [
1009
{
1010
"match": "\\b(in|out)\\b",
1011
"name": "storage.modifier.$1.cs"
1012
},
1013
{
1014
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b",
1015
"name": "entity.name.type.type-parameter.cs"
1016
},
1017
{
1018
"include": "#comment"
1019
},
1020
{
1021
"include": "#punctuation-comma"
1022
},
1023
{
1024
"include": "#attribute-section"
1025
}
1026
]
1027
},
1028
"base-types": {
1029
"begin": ":",
1030
"beginCaptures": {
1031
"0": {
1032
"name": "punctuation.separator.colon.cs"
1033
}
1034
},
1035
"end": "(?=\\{|where|;)",
1036
"patterns": [
1037
{
1038
"include": "#base-class-constructor-call"
1039
},
1040
{
1041
"include": "#type"
1042
},
1043
{
1044
"include": "#punctuation-comma"
1045
},
1046
{
1047
"include": "#preprocessor"
1048
}
1049
]
1050
},
1051
"base-class-constructor-call": {
1052
"begin": "(?x)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.) # qualified name part\n)*\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # type name\n(\n <\n (?<type_args>\n [^<>()]|\n \\((?:[^<>()]|<[^<>()]*>|\\([^<>()]*\\))*\\)|\n <\\g<type_args>*>\n )*\n >\\s*\n)? # optional type arguments\n(?=\\() # followed by argument list",
1053
"beginCaptures": {
1054
"1": {
1055
"name": "entity.name.type.cs"
1056
},
1057
"2": {
1058
"name": "punctuation.accessor.cs"
1059
},
1060
"3": {
1061
"name": "entity.name.type.cs"
1062
},
1063
"4": {
1064
"patterns": [
1065
{
1066
"include": "#type-arguments"
1067
}
1068
]
1069
}
1070
},
1071
"end": "(?<=\\))",
1072
"patterns": [
1073
{
1074
"include": "#argument-list"
1075
}
1076
]
1077
},
1078
"generic-constraints": {
1079
"begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
1080
"beginCaptures": {
1081
"1": {
1082
"name": "storage.modifier.where.cs"
1083
},
1084
"2": {
1085
"name": "entity.name.type.type-parameter.cs"
1086
},
1087
"3": {
1088
"name": "punctuation.separator.colon.cs"
1089
}
1090
},
1091
"end": "(?=\\{|where|;|=>)",
1092
"patterns": [
1093
{
1094
"name": "storage.type.class.cs",
1095
"match": "\\bclass\\b"
1096
},
1097
{
1098
"name": "storage.type.struct.cs",
1099
"match": "\\bstruct\\b"
1100
},
1101
{
1102
"name": "keyword.other.constraint.default.cs",
1103
"match": "\\bdefault\\b"
1104
},
1105
{
1106
"name": "keyword.other.constraint.notnull.cs",
1107
"match": "\\bnotnull\\b"
1108
},
1109
{
1110
"name": "keyword.other.constraint.unmanaged.cs",
1111
"match": "\\bunmanaged\\b"
1112
},
1113
{
1114
"match": "(new)\\s*(\\()\\s*(\\))",
1115
"captures": {
1116
"1": {
1117
"name": "keyword.operator.expression.new.cs"
1118
},
1119
"2": {
1120
"name": "punctuation.parenthesis.open.cs"
1121
},
1122
"3": {
1123
"name": "punctuation.parenthesis.close.cs"
1124
}
1125
}
1126
},
1127
{
1128
"include": "#type"
1129
},
1130
{
1131
"include": "#punctuation-comma"
1132
},
1133
{
1134
"include": "#generic-constraints"
1135
}
1136
]
1137
},
1138
"fixed-size-buffer-declaration": {
1139
"begin": "(?x)\n\\b(fixed)\\b\\s+\n(?<type_name>\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* # Are there any more names being dotted into?\n )\n)\\s+\n(\\g<identifier>)\\s* # buffer name\n(?=\\[)",
1140
"beginCaptures": {
1141
"1": {
1142
"name": "storage.modifier.fixed.cs"
1143
},
1144
"2": {
1145
"patterns": [
1146
{
1147
"include": "#type"
1148
}
1149
]
1150
},
1151
"6": {
1152
"name": "entity.name.variable.field.cs"
1153
}
1154
},
1155
"end": "(?=;)",
1156
"patterns": [
1157
{
1158
"include": "#bracketed-argument-list"
1159
},
1160
{
1161
"include": "#comment"
1162
}
1163
]
1164
},
1165
"field-declaration": {
1166
"begin": "(?x)\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g<identifier>)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)",
1167
"beginCaptures": {
1168
"1": {
1169
"patterns": [
1170
{
1171
"include": "#type"
1172
}
1173
]
1174
},
1175
"6": {
1176
"name": "entity.name.variable.field.cs"
1177
}
1178
},
1179
"end": "(?=;)",
1180
"patterns": [
1181
{
1182
"name": "entity.name.variable.field.cs",
1183
"match": "@?[_[:alpha:]][_[:alnum:]]*"
1184
},
1185
{
1186
"include": "#punctuation-comma"
1187
},
1188
{
1189
"include": "#comment"
1190
},
1191
{
1192
"include": "#variable-initializer"
1193
},
1194
{
1195
"include": "#class-or-struct-members"
1196
}
1197
]
1198
},
1199
"property-declaration": {
1200
"begin": "(?x)\n\n# The negative lookahead below ensures that we don't match nested types\n# or other declarations as properties.\n(?![[:word:][:space:]]*\\b(?:class|interface|struct|enum|event)\\b)\n\n(?<return_type>\n (?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?<interface_name>\\g<type_name>\\s*\\.\\s*)?\n(?<property_name>\\g<identifier>)\\s*\n(?=\\{|=>|//|/\\*|$)",
1201
"beginCaptures": {
1202
"1": {
1203
"patterns": [
1204
{
1205
"include": "#type"
1206
}
1207
]
1208
},
1209
"7": {
1210
"patterns": [
1211
{
1212
"include": "#type"
1213
},
1214
{
1215
"include": "#punctuation-accessor"
1216
}
1217
]
1218
},
1219
"8": {
1220
"name": "entity.name.variable.property.cs"
1221
}
1222
},
1223
"end": "(?<=\\})|(?=;)",
1224
"patterns": [
1225
{
1226
"include": "#comment"
1227
},
1228
{
1229
"include": "#property-accessors"
1230
},
1231
{
1232
"include": "#accessor-getter-expression"
1233
},
1234
{
1235
"include": "#variable-initializer"
1236
},
1237
{
1238
"include": "#class-or-struct-members"
1239
}
1240
]
1241
},
1242
"indexer-declaration": {
1243
"begin": "(?x)\n(?<return_type>\n (?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?<interface_name>\\g<type_name>\\s*\\.\\s*)?\n(?<indexer_name>this)\\s*\n(?=\\[)",
1244
"beginCaptures": {
1245
"1": {
1246
"patterns": [
1247
{
1248
"include": "#type"
1249
}
1250
]
1251
},
1252
"7": {
1253
"patterns": [
1254
{
1255
"include": "#type"
1256
},
1257
{
1258
"include": "#punctuation-accessor"
1259
}
1260
]
1261
},
1262
"8": {
1263
"name": "variable.language.this.cs"
1264
}
1265
},
1266
"end": "(?<=\\})|(?=;)",
1267
"patterns": [
1268
{
1269
"include": "#comment"
1270
},
1271
{
1272
"include": "#bracketed-parameter-list"
1273
},
1274
{
1275
"include": "#property-accessors"
1276
},
1277
{
1278
"include": "#accessor-getter-expression"
1279
},
1280
{
1281
"include": "#variable-initializer"
1282
}
1283
]
1284
},
1285
"event-declaration": {
1286
"begin": "(?x)\n\\b(event)\\b\\s*\n(?<return_type>\n (?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?<interface_name>\\g<type_name>\\s*\\.\\s*)?\n(\\g<identifier>)\\s* # first event name\n(?=\\{|;|,|=|//|/\\*|$)",
1287
"beginCaptures": {
1288
"1": {
1289
"name": "storage.type.event.cs"
1290
},
1291
"2": {
1292
"patterns": [
1293
{
1294
"include": "#type"
1295
}
1296
]
1297
},
1298
"8": {
1299
"patterns": [
1300
{
1301
"include": "#type"
1302
},
1303
{
1304
"include": "#punctuation-accessor"
1305
}
1306
]
1307
},
1308
"9": {
1309
"name": "entity.name.variable.event.cs"
1310
}
1311
},
1312
"end": "(?<=\\})|(?=;)",
1313
"patterns": [
1314
{
1315
"include": "#comment"
1316
},
1317
{
1318
"include": "#event-accessors"
1319
},
1320
{
1321
"name": "entity.name.variable.event.cs",
1322
"match": "@?[_[:alpha:]][_[:alnum:]]*"
1323
},
1324
{
1325
"include": "#punctuation-comma"
1326
},
1327
{
1328
"begin": "=",
1329
"beginCaptures": {
1330
"0": {
1331
"name": "keyword.operator.assignment.cs"
1332
}
1333
},
1334
"end": "(?<=,)|(?=;)",
1335
"patterns": [
1336
{
1337
"include": "#expression"
1338
},
1339
{
1340
"include": "#punctuation-comma"
1341
}
1342
]
1343
}
1344
]
1345
},
1346
"property-accessors": {
1347
"begin": "\\{",
1348
"beginCaptures": {
1349
"0": {
1350
"name": "punctuation.curlybrace.open.cs"
1351
}
1352
},
1353
"end": "\\}",
1354
"endCaptures": {
1355
"0": {
1356
"name": "punctuation.curlybrace.close.cs"
1357
}
1358
},
1359
"patterns": [
1360
{
1361
"include": "#comment"
1362
},
1363
{
1364
"include": "#attribute-section"
1365
},
1366
{
1367
"name": "storage.modifier.$1.cs",
1368
"match": "\\b(private|protected|internal)\\b"
1369
},
1370
{
1371
"begin": "(?:\\b(readonly)\\s+)?\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1372
"beginCaptures": {
1373
"1": {
1374
"name": "storage.modifier.readonly.cs"
1375
},
1376
"2": {
1377
"name": "storage.type.accessor.get.cs"
1378
}
1379
},
1380
"end": "(?<=\\}|;)|(?=\\})",
1381
"patterns": [
1382
{
1383
"include": "#accessor-getter"
1384
}
1385
]
1386
},
1387
{
1388
"begin": "\\b(set|init)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1389
"beginCaptures": {
1390
"1": {
1391
"name": "storage.type.accessor.$1.cs"
1392
}
1393
},
1394
"end": "(?<=\\}|;)|(?=\\})",
1395
"patterns": [
1396
{
1397
"include": "#accessor-setter"
1398
}
1399
]
1400
}
1401
]
1402
},
1403
"event-accessors": {
1404
"begin": "\\{",
1405
"beginCaptures": {
1406
"0": {
1407
"name": "punctuation.curlybrace.open.cs"
1408
}
1409
},
1410
"end": "\\}",
1411
"endCaptures": {
1412
"0": {
1413
"name": "punctuation.curlybrace.close.cs"
1414
}
1415
},
1416
"patterns": [
1417
{
1418
"include": "#comment"
1419
},
1420
{
1421
"include": "#attribute-section"
1422
},
1423
{
1424
"begin": "\\b(add|remove)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1425
"beginCaptures": {
1426
"1": {
1427
"name": "storage.type.accessor.$1.cs"
1428
}
1429
},
1430
"end": "(?<=\\}|;)|(?=\\})",
1431
"patterns": [
1432
{
1433
"include": "#accessor-setter"
1434
}
1435
]
1436
}
1437
]
1438
},
1439
"accessor-getter": {
1440
"patterns": [
1441
{
1442
"begin": "\\{",
1443
"beginCaptures": {
1444
"0": {
1445
"name": "punctuation.curlybrace.open.cs"
1446
}
1447
},
1448
"end": "\\}",
1449
"endCaptures": {
1450
"0": {
1451
"name": "punctuation.curlybrace.close.cs"
1452
}
1453
},
1454
"contentName": "meta.accessor.getter.cs",
1455
"patterns": [
1456
{
1457
"include": "#statement"
1458
}
1459
]
1460
},
1461
{
1462
"include": "#accessor-getter-expression"
1463
},
1464
{
1465
"include": "#punctuation-semicolon"
1466
}
1467
]
1468
},
1469
"accessor-getter-expression": {
1470
"begin": "=>",
1471
"beginCaptures": {
1472
"0": {
1473
"name": "keyword.operator.arrow.cs"
1474
}
1475
},
1476
"end": "(?=;|\\})",
1477
"contentName": "meta.accessor.getter.cs",
1478
"patterns": [
1479
{
1480
"include": "#ref-modifier"
1481
},
1482
{
1483
"include": "#expression"
1484
}
1485
]
1486
},
1487
"accessor-setter": {
1488
"patterns": [
1489
{
1490
"begin": "\\{",
1491
"beginCaptures": {
1492
"0": {
1493
"name": "punctuation.curlybrace.open.cs"
1494
}
1495
},
1496
"end": "\\}",
1497
"endCaptures": {
1498
"0": {
1499
"name": "punctuation.curlybrace.close.cs"
1500
}
1501
},
1502
"contentName": "meta.accessor.setter.cs",
1503
"patterns": [
1504
{
1505
"include": "#statement"
1506
}
1507
]
1508
},
1509
{
1510
"begin": "=>",
1511
"beginCaptures": {
1512
"0": {
1513
"name": "keyword.operator.arrow.cs"
1514
}
1515
},
1516
"end": "(?=;|\\})",
1517
"contentName": "meta.accessor.setter.cs",
1518
"patterns": [
1519
{
1520
"include": "#ref-modifier"
1521
},
1522
{
1523
"include": "#expression"
1524
}
1525
]
1526
},
1527
{
1528
"include": "#punctuation-semicolon"
1529
}
1530
]
1531
},
1532
"method-declaration": {
1533
"begin": "(?x)\n(?<return_type>\n (?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\\s+\n)\n(?<interface_name>\\g<type_name>\\s*\\.\\s*)?\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()",
1534
"beginCaptures": {
1535
"1": {
1536
"patterns": [
1537
{
1538
"include": "#type"
1539
}
1540
]
1541
},
1542
"7": {
1543
"patterns": [
1544
{
1545
"include": "#type"
1546
},
1547
{
1548
"include": "#punctuation-accessor"
1549
}
1550
]
1551
},
1552
"8": {
1553
"name": "entity.name.function.cs"
1554
},
1555
"9": {
1556
"patterns": [
1557
{
1558
"include": "#type-parameter-list"
1559
}
1560
]
1561
}
1562
},
1563
"end": "(?<=\\})|(?=;)",
1564
"patterns": [
1565
{
1566
"include": "#comment"
1567
},
1568
{
1569
"include": "#parenthesized-parameter-list"
1570
},
1571
{
1572
"include": "#generic-constraints"
1573
},
1574
{
1575
"include": "#expression-body"
1576
},
1577
{
1578
"include": "#block"
1579
}
1580
]
1581
},
1582
"constructor-declaration": {
1583
"begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\(|$)",
1584
"beginCaptures": {
1585
"1": {
1586
"name": "entity.name.function.cs"
1587
}
1588
},
1589
"end": "(?<=\\})|(?=;)",
1590
"patterns": [
1591
{
1592
"begin": "(:)",
1593
"beginCaptures": {
1594
"1": {
1595
"name": "punctuation.separator.colon.cs"
1596
}
1597
},
1598
"end": "(?=\\{|=>)",
1599
"patterns": [
1600
{
1601
"include": "#constructor-initializer"
1602
}
1603
]
1604
},
1605
{
1606
"include": "#parenthesized-parameter-list"
1607
},
1608
{
1609
"include": "#preprocessor"
1610
},
1611
{
1612
"include": "#comment"
1613
},
1614
{
1615
"include": "#expression-body"
1616
},
1617
{
1618
"include": "#block"
1619
}
1620
]
1621
},
1622
"constructor-initializer": {
1623
"begin": "\\b(base|this)\\b\\s*(?=\\()",
1624
"beginCaptures": {
1625
"1": {
1626
"name": "variable.language.$1.cs"
1627
}
1628
},
1629
"end": "(?<=\\))",
1630
"patterns": [
1631
{
1632
"include": "#argument-list"
1633
}
1634
]
1635
},
1636
"destructor-declaration": {
1637
"begin": "(~)(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\()",
1638
"beginCaptures": {
1639
"1": {
1640
"name": "punctuation.tilde.cs"
1641
},
1642
"2": {
1643
"name": "entity.name.function.cs"
1644
}
1645
},
1646
"end": "(?<=\\})|(?=;)",
1647
"patterns": [
1648
{
1649
"include": "#comment"
1650
},
1651
{
1652
"include": "#parenthesized-parameter-list"
1653
},
1654
{
1655
"include": "#expression-body"
1656
},
1657
{
1658
"include": "#block"
1659
}
1660
]
1661
},
1662
"operator-declaration": {
1663
"begin": "(?x)\n(?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n\\b(?<operator_keyword>operator)\\b\\s*\n(?<operator>[+\\-*/%&|\\^!=~<>]+|true|false)\\s*\n(?=\\()",
1664
"beginCaptures": {
1665
"1": {
1666
"patterns": [
1667
{
1668
"include": "#type"
1669
}
1670
]
1671
},
1672
"6": {
1673
"name": "storage.type.operator.cs"
1674
},
1675
"7": {
1676
"name": "entity.name.function.cs"
1677
}
1678
},
1679
"end": "(?<=\\})|(?=;)",
1680
"patterns": [
1681
{
1682
"include": "#comment"
1683
},
1684
{
1685
"include": "#parenthesized-parameter-list"
1686
},
1687
{
1688
"include": "#expression-body"
1689
},
1690
{
1691
"include": "#block"
1692
}
1693
]
1694
},
1695
"conversion-operator-declaration": {
1696
"begin": "(?x)\n(?<explicit_or_implicit_keyword>(?:\\b(?:explicit|implicit)))\\s*\n(?<operator_keyword>(?:\\b(?:operator)))\\s*\n(?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?=\\()",
1697
"beginCaptures": {
1698
"1": {
1699
"patterns": [
1700
{
1701
"match": "\\b(explicit)\\b",
1702
"captures": {
1703
"1": {
1704
"name": "storage.modifier.explicit.cs"
1705
}
1706
}
1707
},
1708
{
1709
"match": "\\b(implicit)\\b",
1710
"captures": {
1711
"1": {
1712
"name": "storage.modifier.implicit.cs"
1713
}
1714
}
1715
}
1716
]
1717
},
1718
"2": {
1719
"name": "storage.type.operator.cs"
1720
},
1721
"3": {
1722
"patterns": [
1723
{
1724
"include": "#type"
1725
}
1726
]
1727
}
1728
},
1729
"end": "(?<=\\})|(?=;)",
1730
"patterns": [
1731
{
1732
"include": "#comment"
1733
},
1734
{
1735
"include": "#parenthesized-parameter-list"
1736
},
1737
{
1738
"include": "#expression-body"
1739
},
1740
{
1741
"include": "#block"
1742
}
1743
]
1744
},
1745
"block": {
1746
"begin": "\\{",
1747
"beginCaptures": {
1748
"0": {
1749
"name": "punctuation.curlybrace.open.cs"
1750
}
1751
},
1752
"end": "\\}",
1753
"endCaptures": {
1754
"0": {
1755
"name": "punctuation.curlybrace.close.cs"
1756
}
1757
},
1758
"patterns": [
1759
{
1760
"include": "#statement"
1761
}
1762
]
1763
},
1764
"variable-initializer": {
1765
"begin": "(?<!=|!)(=)(?!=|>)",
1766
"beginCaptures": {
1767
"1": {
1768
"name": "keyword.operator.assignment.cs"
1769
}
1770
},
1771
"end": "(?=[,\\)\\];}])",
1772
"patterns": [
1773
{
1774
"include": "#ref-modifier"
1775
},
1776
{
1777
"include": "#expression"
1778
}
1779
]
1780
},
1781
"expression-body": {
1782
"begin": "=>",
1783
"beginCaptures": {
1784
"0": {
1785
"name": "keyword.operator.arrow.cs"
1786
}
1787
},
1788
"end": "(?=[,\\);}])",
1789
"patterns": [
1790
{
1791
"include": "#ref-modifier"
1792
},
1793
{
1794
"include": "#expression"
1795
}
1796
]
1797
},
1798
"goto-statement": {
1799
"begin": "(?<!\\.)\\b(goto)\\b",
1800
"beginCaptures": {
1801
"1": {
1802
"name": "keyword.control.flow.goto.cs"
1803
}
1804
},
1805
"end": "(?=[;}])",
1806
"patterns": [
1807
{
1808
"begin": "\\b(case)\\b",
1809
"beginCaptures": {
1810
"1": {
1811
"name": "keyword.control.conditional.case.cs"
1812
}
1813
},
1814
"end": "(?=[;}])",
1815
"patterns": [
1816
{
1817
"include": "#expression"
1818
}
1819
]
1820
},
1821
{
1822
"match": "\\b(default)\\b",
1823
"captures": {
1824
"1": {
1825
"name": "keyword.control.conditional.default.cs"
1826
}
1827
}
1828
},
1829
{
1830
"name": "entity.name.label.cs",
1831
"match": "@?[_[:alpha:]][_[:alnum:]]*"
1832
}
1833
]
1834
},
1835
"return-statement": {
1836
"begin": "(?<!\\.)\\b(return)\\b",
1837
"beginCaptures": {
1838
"1": {
1839
"name": "keyword.control.flow.return.cs"
1840
}
1841
},
1842
"end": "(?=[;}])",
1843
"patterns": [
1844
{
1845
"include": "#ref-modifier"
1846
},
1847
{
1848
"include": "#expression"
1849
}
1850
]
1851
},
1852
"break-or-continue-statement": {
1853
"match": "(?<!\\.)\\b(break|continue)\\b",
1854
"name": "keyword.control.flow.$1.cs"
1855
},
1856
"throw-statement": {
1857
"begin": "(?<!\\.)\\b(throw)\\b",
1858
"beginCaptures": {
1859
"1": {
1860
"name": "keyword.control.flow.throw.cs"
1861
}
1862
},
1863
"end": "(?=[;}])",
1864
"patterns": [
1865
{
1866
"include": "#expression"
1867
}
1868
]
1869
},
1870
"yield-statement": {
1871
"patterns": [
1872
{
1873
"include": "#yield-return-statement"
1874
},
1875
{
1876
"include": "#yield-break-statement"
1877
}
1878
]
1879
},
1880
"yield-return-statement": {
1881
"begin": "(?<!\\.)\\b(yield)\\b\\s*\\b(return)\\b",
1882
"beginCaptures": {
1883
"1": {
1884
"name": "keyword.control.flow.yield.cs"
1885
},
1886
"2": {
1887
"name": "keyword.control.flow.return.cs"
1888
}
1889
},
1890
"end": "(?=[;}])",
1891
"patterns": [
1892
{
1893
"include": "#expression"
1894
}
1895
]
1896
},
1897
"yield-break-statement": {
1898
"match": "(?<!\\.)\\b(yield)\\b\\s*\\b(break)\\b",
1899
"captures": {
1900
"1": {
1901
"name": "keyword.control.flow.yield.cs"
1902
},
1903
"2": {
1904
"name": "keyword.control.flow.break.cs"
1905
}
1906
}
1907
},
1908
"await-statement": {
1909
"begin": "(?<!\\.\\s*)\\b(await)\\b",
1910
"beginCaptures": {
1911
"1": {
1912
"name": "keyword.operator.expression.await.cs"
1913
}
1914
},
1915
"end": "(?<=})|(?=;|})",
1916
"patterns": [
1917
{
1918
"include": "#foreach-statement"
1919
},
1920
{
1921
"include": "#using-statement"
1922
},
1923
{
1924
"include": "#expression"
1925
}
1926
]
1927
},
1928
"if-statement": {
1929
"begin": "(?<!\\.)\\b(if)\\b\\s*(?=\\()",
1930
"beginCaptures": {
1931
"1": {
1932
"name": "keyword.control.conditional.if.cs"
1933
}
1934
},
1935
"end": "(?<=})|(?=;)",
1936
"patterns": [
1937
{
1938
"begin": "\\(",
1939
"beginCaptures": {
1940
"0": {
1941
"name": "punctuation.parenthesis.open.cs"
1942
}
1943
},
1944
"end": "\\)",
1945
"endCaptures": {
1946
"0": {
1947
"name": "punctuation.parenthesis.close.cs"
1948
}
1949
},
1950
"patterns": [
1951
{
1952
"include": "#expression"
1953
}
1954
]
1955
},
1956
{
1957
"include": "#statement"
1958
}
1959
]
1960
},
1961
"else-part": {
1962
"begin": "(?<!\\.)\\b(else)\\b",
1963
"beginCaptures": {
1964
"1": {
1965
"name": "keyword.control.conditional.else.cs"
1966
}
1967
},
1968
"end": "(?<=})|(?=;)",
1969
"patterns": [
1970
{
1971
"include": "#statement"
1972
}
1973
]
1974
},
1975
"switch-statement-or-expression": {
1976
"begin": "(?<!\\.)\\b(switch)\\b",
1977
"beginCaptures": {
1978
"1": {
1979
"name": "keyword.control.conditional.switch.cs"
1980
}
1981
},
1982
"end": "(?<=})|(?=})",
1983
"patterns": [
1984
{
1985
"include": "#intrusive"
1986
},
1987
{
1988
"begin": "(?=\\()",
1989
"end": "(?<=\\})|(?=\\})",
1990
"patterns": [
1991
{
1992
"include": "#switch-statement"
1993
}
1994
]
1995
},
1996
{
1997
"begin": "(?=\\{)",
1998
"end": "(?<=\\})|(?=\\})",
1999
"patterns": [
2000
{
2001
"include": "#switch-expression"
2002
}
2003
]
2004
}
2005
]
2006
},
2007
"switch-statement": {
2008
"patterns": [
2009
{
2010
"include": "#intrusive"
2011
},
2012
{
2013
"begin": "\\(",
2014
"beginCaptures": {
2015
"0": {
2016
"name": "punctuation.parenthesis.open.cs"
2017
}
2018
},
2019
"end": "\\)",
2020
"endCaptures": {
2021
"0": {
2022
"name": "punctuation.parenthesis.close.cs"
2023
}
2024
},
2025
"patterns": [
2026
{
2027
"include": "#expression"
2028
}
2029
]
2030
},
2031
{
2032
"begin": "\\{",
2033
"beginCaptures": {
2034
"0": {
2035
"name": "punctuation.curlybrace.open.cs"
2036
}
2037
},
2038
"end": "\\}",
2039
"endCaptures": {
2040
"0": {
2041
"name": "punctuation.curlybrace.close.cs"
2042
}
2043
},
2044
"patterns": [
2045
{
2046
"include": "#switch-label"
2047
},
2048
{
2049
"include": "#statement"
2050
}
2051
]
2052
}
2053
]
2054
},
2055
"switch-label": {
2056
"begin": "\\b(case|default)\\b",
2057
"beginCaptures": {
2058
"1": {
2059
"name": "keyword.control.conditional.$1.cs"
2060
}
2061
},
2062
"end": "(:)|(?=})",
2063
"endCaptures": {
2064
"1": {
2065
"name": "punctuation.separator.colon.cs"
2066
}
2067
},
2068
"patterns": [
2069
{
2070
"begin": "\\b(when)\\b",
2071
"beginCaptures": {
2072
"1": {
2073
"name": "keyword.control.conditional.when.cs"
2074
}
2075
},
2076
"end": "(?=:|})",
2077
"patterns": [
2078
{
2079
"include": "#case-guard"
2080
}
2081
]
2082
},
2083
{
2084
"begin": "(?!\\s)",
2085
"end": "(?=\\bwhen\\b|:|})",
2086
"patterns": [
2087
{
2088
"include": "#pattern"
2089
}
2090
]
2091
}
2092
]
2093
},
2094
"switch-expression": {
2095
"begin": "\\{",
2096
"beginCaptures": {
2097
"0": {
2098
"name": "punctuation.curlybrace.open.cs"
2099
}
2100
},
2101
"end": "\\}",
2102
"endCaptures": {
2103
"0": {
2104
"name": "punctuation.curlybrace.close.cs"
2105
}
2106
},
2107
"patterns": [
2108
{
2109
"include": "#punctuation-comma"
2110
},
2111
{
2112
"begin": "=>",
2113
"beginCaptures": {
2114
"0": {
2115
"name": "keyword.operator.arrow.cs"
2116
}
2117
},
2118
"end": "(?=,|})",
2119
"patterns": [
2120
{
2121
"include": "#expression"
2122
}
2123
]
2124
},
2125
{
2126
"begin": "\\b(when)\\b",
2127
"beginCaptures": {
2128
"1": {
2129
"name": "keyword.control.conditional.when.cs"
2130
}
2131
},
2132
"end": "(?==>|,|})",
2133
"patterns": [
2134
{
2135
"include": "#case-guard"
2136
}
2137
]
2138
},
2139
{
2140
"begin": "(?!\\s)",
2141
"end": "(?=\\bwhen\\b|=>|,|})",
2142
"patterns": [
2143
{
2144
"include": "#pattern"
2145
}
2146
]
2147
}
2148
]
2149
},
2150
"case-guard": {
2151
"patterns": [
2152
{
2153
"include": "#parenthesized-expression"
2154
},
2155
{
2156
"include": "#expression"
2157
}
2158
]
2159
},
2160
"is-expression": {
2161
"begin": "(?<!\\.)\\b(is)\\b",
2162
"beginCaptures": {
2163
"1": {
2164
"name": "keyword.operator.expression.pattern.is.cs"
2165
}
2166
},
2167
"end": "(?=[)}\\],;:?=&|^]|!=)",
2168
"patterns": [
2169
{
2170
"include": "#pattern"
2171
}
2172
]
2173
},
2174
"pattern": {
2175
"patterns": [
2176
{
2177
"include": "#intrusive"
2178
},
2179
{
2180
"include": "#combinator-pattern"
2181
},
2182
{
2183
"include": "#discard-pattern"
2184
},
2185
{
2186
"include": "#constant-pattern"
2187
},
2188
{
2189
"include": "#relational-pattern"
2190
},
2191
{
2192
"include": "#var-pattern"
2193
},
2194
{
2195
"include": "#type-pattern"
2196
},
2197
{
2198
"include": "#positional-pattern"
2199
},
2200
{
2201
"include": "#property-pattern"
2202
},
2203
{
2204
"include": "#list-pattern"
2205
},
2206
{
2207
"include": "#slice-pattern"
2208
}
2209
]
2210
},
2211
"combinator-pattern": {
2212
"match": "\\b(and|or|not)\\b",
2213
"name": "keyword.operator.expression.pattern.combinator.$1.cs"
2214
},
2215
"discard-pattern": {
2216
"match": "_(?![_[:alnum:]])",
2217
"name": "variable.language.discard.cs"
2218
},
2219
"constant-pattern": {
2220
"patterns": [
2221
{
2222
"include": "#boolean-literal"
2223
},
2224
{
2225
"include": "#null-literal"
2226
},
2227
{
2228
"include": "#numeric-literal"
2229
},
2230
{
2231
"include": "#char-literal"
2232
},
2233
{
2234
"include": "#string-literal"
2235
},
2236
{
2237
"include": "#raw-string-literal"
2238
},
2239
{
2240
"include": "#verbatim-string-literal"
2241
},
2242
{
2243
"include": "#type-operator-expression"
2244
},
2245
{
2246
"include": "#expression-operator-expression"
2247
},
2248
{
2249
"include": "#expression-operators"
2250
},
2251
{
2252
"include": "#casted-constant-pattern"
2253
}
2254
]
2255
},
2256
"casted-constant-pattern": {
2257
"begin": "(?x)\n(\\()\n ([\\s.:@_[:alnum:]]+)\n(\\))\n(?=[\\s+\\-!~]*@?[_[:alnum:]('\"]+)",
2258
"beginCaptures": {
2259
"1": {
2260
"name": "punctuation.parenthesis.open.cs"
2261
},
2262
"2": {
2263
"patterns": [
2264
{
2265
"include": "#type-builtin"
2266
},
2267
{
2268
"include": "#type-name"
2269
}
2270
]
2271
},
2272
"3": {
2273
"name": "punctuation.parenthesis.close.cs"
2274
}
2275
},
2276
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2277
"patterns": [
2278
{
2279
"include": "#casted-constant-pattern"
2280
},
2281
{
2282
"begin": "\\(",
2283
"beginCaptures": {
2284
"0": {
2285
"name": "punctuation.parenthesis.open.cs"
2286
}
2287
},
2288
"end": "\\)",
2289
"endCaptures": {
2290
"0": {
2291
"name": "punctuation.parenthesis.close.cs"
2292
}
2293
},
2294
"patterns": [
2295
{
2296
"include": "#constant-pattern"
2297
}
2298
]
2299
},
2300
{
2301
"include": "#constant-pattern"
2302
},
2303
{
2304
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)",
2305
"captures": {
2306
"1": {
2307
"name": "entity.name.type.alias.cs"
2308
},
2309
"2": {
2310
"name": "punctuation.separator.coloncolon.cs"
2311
}
2312
}
2313
},
2314
{
2315
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)",
2316
"captures": {
2317
"1": {
2318
"name": "entity.name.type.cs"
2319
},
2320
"2": {
2321
"name": "punctuation.accessor.cs"
2322
}
2323
}
2324
},
2325
{
2326
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2327
"name": "variable.other.constant.cs"
2328
}
2329
]
2330
},
2331
"relational-pattern": {
2332
"begin": "<=?|>=?",
2333
"beginCaptures": {
2334
"0": {
2335
"name": "keyword.operator.relational.cs"
2336
}
2337
},
2338
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2339
"patterns": [
2340
{
2341
"include": "#expression"
2342
}
2343
]
2344
},
2345
"var-pattern": {
2346
"begin": "\\b(var)\\b",
2347
"beginCaptures": {
2348
"1": {
2349
"name": "storage.type.var.cs"
2350
}
2351
},
2352
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2353
"patterns": [
2354
{
2355
"include": "#designation-pattern"
2356
}
2357
]
2358
},
2359
"designation-pattern": {
2360
"patterns": [
2361
{
2362
"include": "#intrusive"
2363
},
2364
{
2365
"begin": "\\(",
2366
"beginCaptures": {
2367
"0": {
2368
"name": "punctuation.parenthesis.open.cs"
2369
}
2370
},
2371
"end": "\\)",
2372
"endCaptures": {
2373
"0": {
2374
"name": "punctuation.parenthesis.close.cs"
2375
}
2376
},
2377
"patterns": [
2378
{
2379
"include": "#punctuation-comma"
2380
},
2381
{
2382
"include": "#designation-pattern"
2383
}
2384
]
2385
},
2386
{
2387
"include": "#simple-designation-pattern"
2388
}
2389
]
2390
},
2391
"simple-designation-pattern": {
2392
"patterns": [
2393
{
2394
"include": "#discard-pattern"
2395
},
2396
{
2397
"match": "@?[_[:alpha:]][_[:alnum:]]*",
2398
"name": "entity.name.variable.local.cs"
2399
}
2400
]
2401
},
2402
"type-pattern": {
2403
"begin": "(?=@?[_[:alpha:]][_[:alnum:]]*)",
2404
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2405
"patterns": [
2406
{
2407
"begin": "\\G",
2408
"end": "(?!\\G[@_[:alpha:]])(?=[\\({@_[:alpha:])}\\],;:=&|^]|(?:\\s|^)\\?|!=|\\b(and|or|when)\\b)",
2409
"patterns": [
2410
{
2411
"include": "#intrusive"
2412
},
2413
{
2414
"include": "#type-subpattern"
2415
}
2416
]
2417
},
2418
{
2419
"begin": "(?=[\\({@_[:alpha:]])",
2420
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2421
"patterns": [
2422
{
2423
"include": "#intrusive"
2424
},
2425
{
2426
"include": "#positional-pattern"
2427
},
2428
{
2429
"include": "#property-pattern"
2430
},
2431
{
2432
"include": "#simple-designation-pattern"
2433
}
2434
]
2435
}
2436
]
2437
},
2438
"type-subpattern": {
2439
"patterns": [
2440
{
2441
"include": "#type-builtin"
2442
},
2443
{
2444
"begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(::)",
2445
"beginCaptures": {
2446
"1": {
2447
"name": "entity.name.type.alias.cs"
2448
},
2449
"2": {
2450
"name": "punctuation.separator.coloncolon.cs"
2451
}
2452
},
2453
"end": "(?<=[_[:alnum:]])|(?=[.<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2454
"patterns": [
2455
{
2456
"include": "#intrusive"
2457
},
2458
{
2459
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2460
"name": "entity.name.type.cs"
2461
}
2462
]
2463
},
2464
{
2465
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2466
"name": "entity.name.type.cs"
2467
},
2468
{
2469
"begin": "\\.",
2470
"beginCaptures": {
2471
"0": {
2472
"name": "punctuation.accessor.cs"
2473
}
2474
},
2475
"end": "(?<=[_[:alnum:]])|(?=[<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2476
"patterns": [
2477
{
2478
"include": "#intrusive"
2479
},
2480
{
2481
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2482
"name": "entity.name.type.cs"
2483
}
2484
]
2485
},
2486
{
2487
"include": "#type-arguments"
2488
},
2489
{
2490
"include": "#type-array-suffix"
2491
},
2492
{
2493
"match": "(?<!\\s)\\?",
2494
"name": "punctuation.separator.question-mark.cs"
2495
}
2496
]
2497
},
2498
"positional-pattern": {
2499
"begin": "(?=\\()",
2500
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2501
"patterns": [
2502
{
2503
"begin": "\\(",
2504
"beginCaptures": {
2505
"0": {
2506
"name": "punctuation.parenthesis.open.cs"
2507
}
2508
},
2509
"end": "\\)",
2510
"endCaptures": {
2511
"0": {
2512
"name": "punctuation.parenthesis.close.cs"
2513
}
2514
},
2515
"patterns": [
2516
{
2517
"include": "#subpattern"
2518
},
2519
{
2520
"include": "#punctuation-comma"
2521
}
2522
]
2523
},
2524
{
2525
"begin": "(?<=\\))",
2526
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2527
"patterns": [
2528
{
2529
"include": "#intrusive"
2530
},
2531
{
2532
"include": "#property-pattern"
2533
},
2534
{
2535
"include": "#simple-designation-pattern"
2536
}
2537
]
2538
}
2539
]
2540
},
2541
"property-pattern": {
2542
"begin": "(?={)",
2543
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2544
"patterns": [
2545
{
2546
"begin": "\\{",
2547
"beginCaptures": {
2548
"0": {
2549
"name": "punctuation.curlybrace.open.cs"
2550
}
2551
},
2552
"end": "\\}",
2553
"endCaptures": {
2554
"0": {
2555
"name": "punctuation.curlybrace.close.cs"
2556
}
2557
},
2558
"patterns": [
2559
{
2560
"include": "#subpattern"
2561
},
2562
{
2563
"include": "#punctuation-comma"
2564
}
2565
]
2566
},
2567
{
2568
"begin": "(?<=\\})",
2569
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2570
"patterns": [
2571
{
2572
"include": "#intrusive"
2573
},
2574
{
2575
"include": "#simple-designation-pattern"
2576
}
2577
]
2578
}
2579
]
2580
},
2581
"subpattern": {
2582
"patterns": [
2583
{
2584
"match": "(@?[_[:alpha:]][_[:alnum:]]*(?:\\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*)*)\\s*(:)",
2585
"captures": {
2586
"1": {
2587
"patterns": [
2588
{
2589
"match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2590
"name": "variable.other.object.property.cs"
2591
},
2592
{
2593
"include": "#punctuation-accessor"
2594
}
2595
]
2596
},
2597
"2": {
2598
"name": "punctuation.separator.colon.cs"
2599
}
2600
}
2601
},
2602
{
2603
"include": "#pattern"
2604
}
2605
]
2606
},
2607
"list-pattern": {
2608
"begin": "(?=\\[)",
2609
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2610
"patterns": [
2611
{
2612
"begin": "\\[",
2613
"beginCaptures": {
2614
"0": {
2615
"name": "punctuation.squarebracket.open.cs"
2616
}
2617
},
2618
"end": "\\]",
2619
"endCaptures": {
2620
"0": {
2621
"name": "punctuation.squarebracket.close.cs"
2622
}
2623
},
2624
"patterns": [
2625
{
2626
"include": "#pattern"
2627
},
2628
{
2629
"include": "#punctuation-comma"
2630
}
2631
]
2632
},
2633
{
2634
"begin": "(?<=\\])",
2635
"end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2636
"patterns": [
2637
{
2638
"include": "#intrusive"
2639
},
2640
{
2641
"include": "#simple-designation-pattern"
2642
}
2643
]
2644
}
2645
]
2646
},
2647
"slice-pattern": {
2648
"match": "\\.\\.",
2649
"name": "keyword.operator.range.cs"
2650
},
2651
"do-statement": {
2652
"begin": "(?<!\\.)\\b(do)\\b",
2653
"beginCaptures": {
2654
"1": {
2655
"name": "keyword.control.loop.do.cs"
2656
}
2657
},
2658
"end": "(?=;|})",
2659
"patterns": [
2660
{
2661
"include": "#statement"
2662
}
2663
]
2664
},
2665
"while-statement": {
2666
"begin": "(?<!\\.)\\b(while)\\b\\s*(?=\\()",
2667
"beginCaptures": {
2668
"1": {
2669
"name": "keyword.control.loop.while.cs"
2670
}
2671
},
2672
"end": "(?<=\\})|(?=;)",
2673
"patterns": [
2674
{
2675
"begin": "\\(",
2676
"beginCaptures": {
2677
"0": {
2678
"name": "punctuation.parenthesis.open.cs"
2679
}
2680
},
2681
"end": "\\)",
2682
"endCaptures": {
2683
"0": {
2684
"name": "punctuation.parenthesis.close.cs"
2685
}
2686
},
2687
"patterns": [
2688
{
2689
"include": "#expression"
2690
}
2691
]
2692
},
2693
{
2694
"include": "#statement"
2695
}
2696
]
2697
},
2698
"for-statement": {
2699
"begin": "\\b(for)\\b",
2700
"beginCaptures": {
2701
"1": {
2702
"name": "keyword.control.loop.for.cs"
2703
}
2704
},
2705
"end": "(?<=\\))|(?=;|})",
2706
"patterns": [
2707
{
2708
"begin": "\\(",
2709
"beginCaptures": {
2710
"0": {
2711
"name": "punctuation.parenthesis.open.cs"
2712
}
2713
},
2714
"end": "\\)",
2715
"endCaptures": {
2716
"0": {
2717
"name": "punctuation.parenthesis.close.cs"
2718
}
2719
},
2720
"patterns": [
2721
{
2722
"begin": "(?=[^;\\)])",
2723
"end": "(?=;|\\))",
2724
"patterns": [
2725
{
2726
"include": "#intrusive"
2727
},
2728
{
2729
"include": "#local-variable-declaration"
2730
},
2731
{
2732
"include": "#local-tuple-var-deconstruction"
2733
},
2734
{
2735
"include": "#tuple-deconstruction-assignment"
2736
},
2737
{
2738
"include": "#expression"
2739
}
2740
]
2741
},
2742
{
2743
"begin": "(?=;)",
2744
"end": "(?=\\))",
2745
"patterns": [
2746
{
2747
"include": "#intrusive"
2748
},
2749
{
2750
"include": "#expression"
2751
},
2752
{
2753
"include": "#punctuation-comma"
2754
},
2755
{
2756
"include": "#punctuation-semicolon"
2757
}
2758
]
2759
}
2760
]
2761
}
2762
]
2763
},
2764
"foreach-statement": {
2765
"begin": "\\b(foreach)\\b",
2766
"beginCaptures": {
2767
"1": {
2768
"name": "keyword.control.loop.foreach.cs"
2769
}
2770
},
2771
"end": "(?<=\\))|(?=;|})",
2772
"patterns": [
2773
{
2774
"include": "#intrusive"
2775
},
2776
{
2777
"begin": "\\(",
2778
"beginCaptures": {
2779
"0": {
2780
"name": "punctuation.parenthesis.open.cs"
2781
}
2782
},
2783
"end": "\\)",
2784
"endCaptures": {
2785
"0": {
2786
"name": "punctuation.parenthesis.close.cs"
2787
}
2788
},
2789
"patterns": [
2790
{
2791
"include": "#intrusive"
2792
},
2793
{
2794
"match": "(?x)\n(?:\n (?:(\\bref)\\s+)?(\\bvar\\b)| # ref local\n (?<type_name>\n (?:\n (?:ref\\s+)? # ref local\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g<identifier>)\\s+\n\\b(in)\\b",
2795
"captures": {
2796
"1": {
2797
"name": "storage.modifier.ref.cs"
2798
},
2799
"2": {
2800
"name": "storage.type.var.cs"
2801
},
2802
"3": {
2803
"patterns": [
2804
{
2805
"include": "#type"
2806
}
2807
]
2808
},
2809
"8": {
2810
"name": "entity.name.variable.local.cs"
2811
},
2812
"9": {
2813
"name": "keyword.control.loop.in.cs"
2814
}
2815
}
2816
},
2817
{
2818
"match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s+\n\\b(in)\\b",
2819
"captures": {
2820
"1": {
2821
"name": "storage.type.var.cs"
2822
},
2823
"2": {
2824
"patterns": [
2825
{
2826
"include": "#tuple-declaration-deconstruction-element-list"
2827
}
2828
]
2829
},
2830
"3": {
2831
"name": "keyword.control.loop.in.cs"
2832
}
2833
}
2834
},
2835
{
2836
"include": "#expression"
2837
}
2838
]
2839
}
2840
]
2841
},
2842
"try-statement": {
2843
"patterns": [
2844
{
2845
"include": "#try-block"
2846
},
2847
{
2848
"include": "#catch-clause"
2849
},
2850
{
2851
"include": "#finally-clause"
2852
}
2853
]
2854
},
2855
"try-block": {
2856
"begin": "(?<!\\.)\\b(try)\\b",
2857
"beginCaptures": {
2858
"1": {
2859
"name": "keyword.control.exception.try.cs"
2860
}
2861
},
2862
"end": "(?<=\\})",
2863
"patterns": [
2864
{
2865
"include": "#comment"
2866
},
2867
{
2868
"include": "#block"
2869
}
2870
]
2871
},
2872
"finally-clause": {
2873
"begin": "(?<!\\.)\\b(finally)\\b",
2874
"beginCaptures": {
2875
"1": {
2876
"name": "keyword.control.exception.finally.cs"
2877
}
2878
},
2879
"end": "(?<=\\})",
2880
"patterns": [
2881
{
2882
"include": "#comment"
2883
},
2884
{
2885
"include": "#block"
2886
}
2887
]
2888
},
2889
"catch-clause": {
2890
"begin": "(?<!\\.)\\b(catch)\\b",
2891
"beginCaptures": {
2892
"1": {
2893
"name": "keyword.control.exception.catch.cs"
2894
}
2895
},
2896
"end": "(?<=\\})",
2897
"patterns": [
2898
{
2899
"begin": "\\(",
2900
"beginCaptures": {
2901
"0": {
2902
"name": "punctuation.parenthesis.open.cs"
2903
}
2904
},
2905
"end": "\\)",
2906
"endCaptures": {
2907
"0": {
2908
"name": "punctuation.parenthesis.close.cs"
2909
}
2910
},
2911
"patterns": [
2912
{
2913
"match": "(?x)\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?:(\\g<identifier>)\\b)?",
2914
"captures": {
2915
"1": {
2916
"patterns": [
2917
{
2918
"include": "#type"
2919
}
2920
]
2921
},
2922
"6": {
2923
"name": "entity.name.variable.local.cs"
2924
}
2925
}
2926
}
2927
]
2928
},
2929
{
2930
"include": "#when-clause"
2931
},
2932
{
2933
"include": "#comment"
2934
},
2935
{
2936
"include": "#block"
2937
}
2938
]
2939
},
2940
"when-clause": {
2941
"begin": "(?<!\\.)\\b(when)\\b\\s*(\\()",
2942
"beginCaptures": {
2943
"1": {
2944
"name": "keyword.control.exception.when.cs"
2945
},
2946
"2": {
2947
"name": "punctuation.parenthesis.open.cs"
2948
}
2949
},
2950
"end": "\\)",
2951
"endCaptures": {
2952
"0": {
2953
"name": "punctuation.parenthesis.close.cs"
2954
}
2955
},
2956
"patterns": [
2957
{
2958
"include": "#expression"
2959
},
2960
{
2961
"include": "#comment"
2962
}
2963
]
2964
},
2965
"context-control-statement": {
2966
"match": "\\b(checked|unchecked|unsafe)\\b(?!\\s*[@_[:alpha:](])",
2967
"name": "keyword.control.context.$1.cs"
2968
},
2969
"context-control-paren-statement": {
2970
"patterns": [
2971
{
2972
"include": "#fixed-statement"
2973
},
2974
{
2975
"include": "#lock-statement"
2976
},
2977
{
2978
"include": "#using-statement"
2979
}
2980
]
2981
},
2982
"fixed-statement": {
2983
"begin": "\\b(fixed)\\b",
2984
"beginCaptures": {
2985
"1": {
2986
"name": "keyword.control.context.fixed.cs"
2987
}
2988
},
2989
"end": "(?<=\\))|(?=;|})",
2990
"patterns": [
2991
{
2992
"include": "#intrusive"
2993
},
2994
{
2995
"begin": "\\(",
2996
"beginCaptures": {
2997
"0": {
2998
"name": "punctuation.parenthesis.open.cs"
2999
}
3000
},
3001
"end": "\\)",
3002
"endCaptures": {
3003
"0": {
3004
"name": "punctuation.parenthesis.close.cs"
3005
}
3006
},
3007
"patterns": [
3008
{
3009
"include": "#intrusive"
3010
},
3011
{
3012
"include": "#local-variable-declaration"
3013
}
3014
]
3015
}
3016
]
3017
},
3018
"lock-statement": {
3019
"begin": "\\b(lock)\\b",
3020
"beginCaptures": {
3021
"1": {
3022
"name": "keyword.control.context.lock.cs"
3023
}
3024
},
3025
"end": "(?<=\\))|(?=;|})",
3026
"patterns": [
3027
{
3028
"include": "#intrusive"
3029
},
3030
{
3031
"begin": "\\(",
3032
"beginCaptures": {
3033
"0": {
3034
"name": "punctuation.parenthesis.open.cs"
3035
}
3036
},
3037
"end": "\\)",
3038
"endCaptures": {
3039
"0": {
3040
"name": "punctuation.parenthesis.close.cs"
3041
}
3042
},
3043
"patterns": [
3044
{
3045
"include": "#intrusive"
3046
},
3047
{
3048
"include": "#expression"
3049
}
3050
]
3051
}
3052
]
3053
},
3054
"using-statement": {
3055
"begin": "\\b(using)\\b",
3056
"beginCaptures": {
3057
"1": {
3058
"name": "keyword.control.context.using.cs"
3059
}
3060
},
3061
"end": "(?<=\\))|(?=;|})",
3062
"patterns": [
3063
{
3064
"include": "#intrusive"
3065
},
3066
{
3067
"begin": "\\(",
3068
"beginCaptures": {
3069
"0": {
3070
"name": "punctuation.parenthesis.open.cs"
3071
}
3072
},
3073
"end": "\\)",
3074
"endCaptures": {
3075
"0": {
3076
"name": "punctuation.parenthesis.close.cs"
3077
}
3078
},
3079
"patterns": [
3080
{
3081
"include": "#intrusive"
3082
},
3083
{
3084
"include": "#await-expression"
3085
},
3086
{
3087
"include": "#local-variable-declaration"
3088
},
3089
{
3090
"include": "#expression"
3091
}
3092
]
3093
},
3094
{
3095
"include": "#local-variable-declaration"
3096
}
3097
]
3098
},
3099
"labeled-statement": {
3100
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
3101
"captures": {
3102
"1": {
3103
"name": "entity.name.label.cs"
3104
},
3105
"2": {
3106
"name": "punctuation.separator.colon.cs"
3107
}
3108
}
3109
},
3110
"local-declaration": {
3111
"patterns": [
3112
{
3113
"include": "#local-constant-declaration"
3114
},
3115
{
3116
"include": "#local-variable-declaration"
3117
},
3118
{
3119
"include": "#local-function-declaration"
3120
},
3121
{
3122
"include": "#local-tuple-var-deconstruction"
3123
},
3124
{
3125
"include": "#local-tuple-declaration-deconstruction"
3126
}
3127
]
3128
},
3129
"local-variable-declaration": {
3130
"begin": "(?x)\n(?:\n (?:(\\bref)\\s+(?:(\\breadonly)\\s+)?)?(\\bvar\\b)| # ref local\n (?<type_name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g<identifier>)\\s*\n(?!=>)\n(?=,|;|=|\\))",
3131
"beginCaptures": {
3132
"1": {
3133
"name": "storage.modifier.ref.cs"
3134
},
3135
"2": {
3136
"name": "storage.modifier.readonly.cs"
3137
},
3138
"3": {
3139
"name": "storage.type.var.cs"
3140
},
3141
"4": {
3142
"patterns": [
3143
{
3144
"include": "#type"
3145
}
3146
]
3147
},
3148
"9": {
3149
"name": "entity.name.variable.local.cs"
3150
}
3151
},
3152
"end": "(?=[;)}])",
3153
"patterns": [
3154
{
3155
"name": "entity.name.variable.local.cs",
3156
"match": "@?[_[:alpha:]][_[:alnum:]]*"
3157
},
3158
{
3159
"include": "#punctuation-comma"
3160
},
3161
{
3162
"include": "#comment"
3163
},
3164
{
3165
"include": "#variable-initializer"
3166
}
3167
]
3168
},
3169
"local-constant-declaration": {
3170
"begin": "(?x)\n(?<const_keyword>\\b(?:const)\\b)\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g<identifier>)\\s*\n(?=,|;|=)",
3171
"beginCaptures": {
3172
"1": {
3173
"name": "storage.modifier.const.cs"
3174
},
3175
"2": {
3176
"patterns": [
3177
{
3178
"include": "#type"
3179
}
3180
]
3181
},
3182
"7": {
3183
"name": "entity.name.variable.local.cs"
3184
}
3185
},
3186
"end": "(?=;)",
3187
"patterns": [
3188
{
3189
"name": "entity.name.variable.local.cs",
3190
"match": "@?[_[:alpha:]][_[:alnum:]]*"
3191
},
3192
{
3193
"include": "#punctuation-comma"
3194
},
3195
{
3196
"include": "#comment"
3197
},
3198
{
3199
"include": "#variable-initializer"
3200
}
3201
]
3202
},
3203
"local-function-declaration": {
3204
"begin": "(?x)\n\\b((?:(?:async|unsafe|static|extern)\\s+)*)\n(?<type_name>\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n \\s*(?:,\\s*)* # commata for multi-dimensional arrays\n \\]\n (?:\\s*\\?)? # arrays can be nullable reference types\n )*\n)\\s+\n(\\g<identifier>)\\s*\n(<[^<>]+>)?\\s*\n(?=\\()",
3205
"beginCaptures": {
3206
"1": {
3207
"patterns": [
3208
{
3209
"include": "#storage-modifier"
3210
}
3211
]
3212
},
3213
"2": {
3214
"patterns": [
3215
{
3216
"include": "#type"
3217
}
3218
]
3219
},
3220
"7": {
3221
"name": "entity.name.function.cs"
3222
},
3223
"8": {
3224
"patterns": [
3225
{
3226
"include": "#type-parameter-list"
3227
}
3228
]
3229
}
3230
},
3231
"end": "(?<=\\})|(?=;)",
3232
"patterns": [
3233
{
3234
"include": "#comment"
3235
},
3236
{
3237
"include": "#parenthesized-parameter-list"
3238
},
3239
{
3240
"include": "#generic-constraints"
3241
},
3242
{
3243
"include": "#expression-body"
3244
},
3245
{
3246
"include": "#block"
3247
}
3248
]
3249
},
3250
"local-tuple-var-deconstruction": {
3251
"begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s*\n(?=;|=|\\))",
3252
"beginCaptures": {
3253
"1": {
3254
"name": "storage.type.var.cs"
3255
},
3256
"2": {
3257
"patterns": [
3258
{
3259
"include": "#tuple-declaration-deconstruction-element-list"
3260
}
3261
]
3262
}
3263
},
3264
"end": "(?=;|\\))",
3265
"patterns": [
3266
{
3267
"include": "#comment"
3268
},
3269
{
3270
"include": "#variable-initializer"
3271
}
3272
]
3273
},
3274
"local-tuple-declaration-deconstruction": {
3275
"match": "(?x) # e.g. (int x, var y) = GetPoint();\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s*\n(?!=>|==)(?==)",
3276
"captures": {
3277
"1": {
3278
"patterns": [
3279
{
3280
"include": "#tuple-declaration-deconstruction-element-list"
3281
}
3282
]
3283
}
3284
}
3285
},
3286
"tuple-deconstruction-assignment": {
3287
"match": "(?x)\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s*\n(?!=>|==)(?==)",
3288
"captures": {
3289
"1": {
3290
"patterns": [
3291
{
3292
"include": "#tuple-deconstruction-element-list"
3293
}
3294
]
3295
}
3296
}
3297
},
3298
"tuple-declaration-deconstruction-element-list": {
3299
"begin": "\\(",
3300
"beginCaptures": {
3301
"0": {
3302
"name": "punctuation.parenthesis.open.cs"
3303
}
3304
},
3305
"end": "\\)",
3306
"endCaptures": {
3307
"0": {
3308
"name": "punctuation.parenthesis.close.cs"
3309
}
3310
},
3311
"patterns": [
3312
{
3313
"include": "#comment"
3314
},
3315
{
3316
"include": "#tuple-declaration-deconstruction-element-list"
3317
},
3318
{
3319
"include": "#declaration-expression-tuple"
3320
},
3321
{
3322
"include": "#punctuation-comma"
3323
},
3324
{
3325
"match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])",
3326
"captures": {
3327
"1": {
3328
"name": "entity.name.variable.tuple-element.cs"
3329
}
3330
}
3331
}
3332
]
3333
},
3334
"tuple-deconstruction-element-list": {
3335
"begin": "\\(",
3336
"beginCaptures": {
3337
"0": {
3338
"name": "punctuation.parenthesis.open.cs"
3339
}
3340
},
3341
"end": "\\)",
3342
"endCaptures": {
3343
"0": {
3344
"name": "punctuation.parenthesis.close.cs"
3345
}
3346
},
3347
"patterns": [
3348
{
3349
"include": "#comment"
3350
},
3351
{
3352
"include": "#tuple-deconstruction-element-list"
3353
},
3354
{
3355
"include": "#declaration-expression-tuple"
3356
},
3357
{
3358
"include": "#punctuation-comma"
3359
},
3360
{
3361
"match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])",
3362
"captures": {
3363
"1": {
3364
"name": "variable.other.readwrite.cs"
3365
}
3366
}
3367
}
3368
]
3369
},
3370
"declaration-expression-local": {
3371
"match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g<identifier>)\\b\\s*\n(?=[,)\\]])",
3372
"captures": {
3373
"1": {
3374
"name": "storage.type.var.cs"
3375
},
3376
"2": {
3377
"patterns": [
3378
{
3379
"include": "#type"
3380
}
3381
]
3382
},
3383
"7": {
3384
"name": "entity.name.variable.local.cs"
3385
}
3386
}
3387
},
3388
"declaration-expression-tuple": {
3389
"match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n )\n)\\s+\n(\\g<identifier>)\\b\\s*\n(?=[,)])",
3390
"captures": {
3391
"1": {
3392
"name": "storage.type.var.cs"
3393
},
3394
"2": {
3395
"patterns": [
3396
{
3397
"include": "#type"
3398
}
3399
]
3400
},
3401
"7": {
3402
"name": "entity.name.variable.tuple-element.cs"
3403
}
3404
}
3405
},
3406
"expression-operator-expression": {
3407
"begin": "\\b(checked|unchecked|nameof)\\s*(\\()",
3408
"beginCaptures": {
3409
"1": {
3410
"name": "keyword.operator.expression.$1.cs"
3411
},
3412
"2": {
3413
"name": "punctuation.parenthesis.open.cs"
3414
}
3415
},
3416
"end": "\\)",
3417
"endCaptures": {
3418
"0": {
3419
"name": "punctuation.parenthesis.close.cs"
3420
}
3421
},
3422
"patterns": [
3423
{
3424
"include": "#expression"
3425
}
3426
]
3427
},
3428
"type-operator-expression": {
3429
"begin": "\\b(default|sizeof|typeof)\\s*(\\()",
3430
"beginCaptures": {
3431
"1": {
3432
"name": "keyword.operator.expression.$1.cs"
3433
},
3434
"2": {
3435
"name": "punctuation.parenthesis.open.cs"
3436
}
3437
},
3438
"end": "\\)",
3439
"endCaptures": {
3440
"0": {
3441
"name": "punctuation.parenthesis.close.cs"
3442
}
3443
},
3444
"patterns": [
3445
{
3446
"include": "#type"
3447
}
3448
]
3449
},
3450
"default-literal-expression": {
3451
"match": "\\b(default)\\b",
3452
"captures": {
3453
"1": {
3454
"name": "keyword.operator.expression.default.cs"
3455
}
3456
}
3457
},
3458
"throw-expression": {
3459
"match": "\\b(throw)\\b",
3460
"captures": {
3461
"1": {
3462
"name": "keyword.control.flow.throw.cs"
3463
}
3464
}
3465
},
3466
"interpolated-string": {
3467
"name": "string.quoted.double.cs",
3468
"begin": "\\$\"",
3469
"beginCaptures": {
3470
"0": {
3471
"name": "punctuation.definition.string.begin.cs"
3472
}
3473
},
3474
"end": "(\")|((?:[^\\\\\\n])$)",
3475
"endCaptures": {
3476
"1": {
3477
"name": "punctuation.definition.string.end.cs"
3478
},
3479
"2": {
3480
"name": "invalid.illegal.newline.cs"
3481
}
3482
},
3483
"patterns": [
3484
{
3485
"include": "#string-character-escape"
3486
},
3487
{
3488
"include": "#interpolation"
3489
}
3490
]
3491
},
3492
"verbatim-interpolated-string": {
3493
"name": "string.quoted.double.cs",
3494
"begin": "(?:\\$@|@\\$)\"",
3495
"beginCaptures": {
3496
"0": {
3497
"name": "punctuation.definition.string.begin.cs"
3498
}
3499
},
3500
"end": "\"(?=[^\"])",
3501
"endCaptures": {
3502
"0": {
3503
"name": "punctuation.definition.string.end.cs"
3504
}
3505
},
3506
"patterns": [
3507
{
3508
"include": "#verbatim-string-character-escape"
3509
},
3510
{
3511
"include": "#interpolation"
3512
}
3513
]
3514
},
3515
"interpolation": {
3516
"name": "meta.embedded.interpolation.cs",
3517
"begin": "(?<=[^\\{]|^)((?:\\{\\{)*)(\\{)(?=[^\\{])",
3518
"beginCaptures": {
3519
"1": {
3520
"name": "string.quoted.double.cs"
3521
},
3522
"2": {
3523
"name": "punctuation.definition.interpolation.begin.cs"
3524
}
3525
},
3526
"end": "\\}",
3527
"endCaptures": {
3528
"0": {
3529
"name": "punctuation.definition.interpolation.end.cs"
3530
}
3531
},
3532
"patterns": [
3533
{
3534
"include": "#expression"
3535
}
3536
]
3537
},
3538
"raw-interpolated-string": {
3539
"patterns": [
3540
{
3541
"include": "#raw-interpolated-string-five-or-more-quote-one-or-more-interpolation"
3542
},
3543
{
3544
"include": "#raw-interpolated-string-three-or-more-quote-three-or-more-interpolation"
3545
},
3546
{
3547
"include": "#raw-interpolated-string-quadruple-quote-double-interpolation"
3548
},
3549
{
3550
"include": "#raw-interpolated-string-quadruple-quote-single-interpolation"
3551
},
3552
{
3553
"include": "#raw-interpolated-string-triple-quote-double-interpolation"
3554
},
3555
{
3556
"include": "#raw-interpolated-string-triple-quote-single-interpolation"
3557
}
3558
]
3559
},
3560
"raw-interpolated-string-triple-quote-single-interpolation": {
3561
"name": "string.quoted.double.cs",
3562
"begin": "\\$\"\"\"",
3563
"beginCaptures": {
3564
"0": {
3565
"name": "punctuation.definition.string.begin.cs"
3566
}
3567
},
3568
"end": "\"\"\"",
3569
"endCaptures": {
3570
"0": {
3571
"name": "punctuation.definition.string.end.cs"
3572
}
3573
},
3574
"patterns": [
3575
{
3576
"include": "#raw-interpolation"
3577
}
3578
]
3579
},
3580
"raw-interpolated-string-triple-quote-double-interpolation": {
3581
"name": "string.quoted.double.cs",
3582
"begin": "\\$\\$\"\"\"",
3583
"beginCaptures": {
3584
"0": {
3585
"name": "punctuation.definition.string.begin.cs"
3586
}
3587
},
3588
"end": "\"\"\"",
3589
"endCaptures": {
3590
"0": {
3591
"name": "punctuation.definition.string.end.cs"
3592
}
3593
},
3594
"patterns": [
3595
{
3596
"include": "#double-raw-interpolation"
3597
}
3598
]
3599
},
3600
"raw-interpolated-string-quadruple-quote-single-interpolation": {
3601
"name": "string.quoted.double.cs",
3602
"begin": "\\$\"\"\"\"",
3603
"beginCaptures": {
3604
"0": {
3605
"name": "punctuation.definition.string.begin.cs"
3606
}
3607
},
3608
"end": "\"\"\"\"",
3609
"endCaptures": {
3610
"0": {
3611
"name": "punctuation.definition.string.end.cs"
3612
}
3613
},
3614
"patterns": [
3615
{
3616
"include": "#raw-interpolation"
3617
}
3618
]
3619
},
3620
"raw-interpolated-string-quadruple-quote-double-interpolation": {
3621
"name": "string.quoted.double.cs",
3622
"begin": "\\$\\$\"\"\"\"",
3623
"beginCaptures": {
3624
"0": {
3625
"name": "punctuation.definition.string.begin.cs"
3626
}
3627
},
3628
"end": "\"\"\"\"",
3629
"endCaptures": {
3630
"0": {
3631
"name": "punctuation.definition.string.end.cs"
3632
}
3633
},
3634
"patterns": [
3635
{
3636
"include": "#double-raw-interpolation"
3637
}
3638
]
3639
},
3640
"raw-interpolated-string-three-or-more-quote-three-or-more-interpolation": {
3641
"name": "string.quoted.double.cs",
3642
"begin": "\\$\\$\\$+\"\"\"+",
3643
"beginCaptures": {
3644
"0": {
3645
"name": "punctuation.definition.string.begin.cs"
3646
}
3647
},
3648
"end": "\"\"\"+",
3649
"endCaptures": {
3650
"0": {
3651
"name": "punctuation.definition.string.end.cs"
3652
}
3653
}
3654
},
3655
"raw-interpolated-string-five-or-more-quote-one-or-more-interpolation": {
3656
"name": "string.quoted.double.cs",
3657
"begin": "\\$+\"\"\"\"\"+",
3658
"beginCaptures": {
3659
"0": {
3660
"name": "punctuation.definition.string.begin.cs"
3661
}
3662
},
3663
"end": "\"\"\"\"\"+",
3664
"endCaptures": {
3665
"0": {
3666
"name": "punctuation.definition.string.end.cs"
3667
}
3668
}
3669
},
3670
"raw-interpolation": {
3671
"name": "meta.embedded.interpolation.cs",
3672
"begin": "(?<=[^\\{]|^)((?:\\{)*)(\\{)(?=[^\\{])",
3673
"beginCaptures": {
3674
"1": {
3675
"name": "string.quoted.double.cs"
3676
},
3677
"2": {
3678
"name": "punctuation.definition.interpolation.begin.cs"
3679
}
3680
},
3681
"end": "\\}",
3682
"endCaptures": {
3683
"0": {
3684
"name": "punctuation.definition.interpolation.end.cs"
3685
}
3686
},
3687
"patterns": [
3688
{
3689
"include": "#expression"
3690
}
3691
]
3692
},
3693
"double-raw-interpolation": {
3694
"name": "meta.embedded.interpolation.cs",
3695
"begin": "(?<=[^\\{][^\\{]|^)((?:\\{)*)(\\{\\{)(?=[^\\{])",
3696
"beginCaptures": {
3697
"1": {
3698
"name": "string.quoted.double.cs"
3699
},
3700
"2": {
3701
"name": "punctuation.definition.interpolation.begin.cs"
3702
}
3703
},
3704
"end": "\\}\\}",
3705
"endCaptures": {
3706
"0": {
3707
"name": "punctuation.definition.interpolation.end.cs"
3708
}
3709
},
3710
"patterns": [
3711
{
3712
"include": "#expression"
3713
}
3714
]
3715
},
3716
"literal": {
3717
"patterns": [
3718
{
3719
"include": "#boolean-literal"
3720
},
3721
{
3722
"include": "#null-literal"
3723
},
3724
{
3725
"include": "#numeric-literal"
3726
},
3727
{
3728
"include": "#char-literal"
3729
},
3730
{
3731
"include": "#raw-string-literal"
3732
},
3733
{
3734
"include": "#string-literal"
3735
},
3736
{
3737
"include": "#verbatim-string-literal"
3738
},
3739
{
3740
"include": "#tuple-literal"
3741
}
3742
]
3743
},
3744
"boolean-literal": {
3745
"patterns": [
3746
{
3747
"name": "constant.language.boolean.true.cs",
3748
"match": "(?<!\\.)\\btrue\\b"
3749
},
3750
{
3751
"name": "constant.language.boolean.false.cs",
3752
"match": "(?<!\\.)\\bfalse\\b"
3753
}
3754
]
3755
},
3756
"null-literal": {
3757
"name": "constant.language.null.cs",
3758
"match": "(?<!\\.)\\bnull\\b"
3759
},
3760
"numeric-literal": {
3761
"match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_]|_)|(?<=[eE])[+-]|\\.\\d)*",
3762
"captures": {
3763
"0": {
3764
"patterns": [
3765
{
3766
"begin": "(?=.)",
3767
"end": "$",
3768
"patterns": [
3769
{
3770
"match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?((?:(?<=[0-9])|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?((?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?([fFdDmM](?!\\w))?$",
3771
"captures": {
3772
"2": {
3773
"name": "constant.numeric.decimal.cs",
3774
"patterns": [
3775
{
3776
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3777
"name": "constant.numeric.other.separator.thousands.cs"
3778
}
3779
]
3780
},
3781
"3": {
3782
"name": "constant.numeric.other.separator.thousands.cs"
3783
},
3784
"4": {
3785
"name": "constant.numeric.other.separator.decimals.cs"
3786
},
3787
"5": {
3788
"name": "constant.numeric.decimal.cs",
3789
"patterns": [
3790
{
3791
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3792
"name": "constant.numeric.other.separator.thousands.cs"
3793
}
3794
]
3795
},
3796
"6": {
3797
"name": "constant.numeric.other.separator.thousands.cs"
3798
},
3799
"8": {
3800
"name": "constant.numeric.other.exponent.cs"
3801
},
3802
"9": {
3803
"name": "keyword.operator.arithmetic.cs"
3804
},
3805
"10": {
3806
"name": "keyword.operator.arithmetic.cs"
3807
},
3808
"11": {
3809
"name": "constant.numeric.decimal.cs",
3810
"patterns": [
3811
{
3812
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3813
"name": "constant.numeric.other.separator.thousands.cs"
3814
}
3815
]
3816
},
3817
"12": {
3818
"name": "constant.numeric.other.suffix.cs"
3819
}
3820
}
3821
},
3822
{
3823
"match": "(\\G0[bB])([01_](?:[01_]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?:(?:(?:(?:[uU]|[uU]l)|[uU]L)|l[uU]?)|L[uU]?)|[fFdDmM])(?!\\w))?$",
3824
"captures": {
3825
"1": {
3826
"name": "constant.numeric.other.preffix.binary.cs"
3827
},
3828
"2": {
3829
"name": "constant.numeric.binary.cs",
3830
"patterns": [
3831
{
3832
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3833
"name": "constant.numeric.other.separator.thousands.cs"
3834
}
3835
]
3836
},
3837
"3": {
3838
"name": "constant.numeric.other.separator.thousands.cs"
3839
},
3840
"4": {
3841
"name": "constant.numeric.other.suffix.cs"
3842
}
3843
}
3844
},
3845
{
3846
"match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?:(?:(?:(?:[uU]|[uU]l)|[uU]L)|l[uU]?)|L[uU]?)|[fFdDmM])(?!\\w))?$",
3847
"captures": {
3848
"1": {
3849
"name": "constant.numeric.other.preffix.hex.cs"
3850
},
3851
"2": {
3852
"name": "constant.numeric.hex.cs",
3853
"patterns": [
3854
{
3855
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3856
"name": "constant.numeric.other.separator.thousands.cs"
3857
}
3858
]
3859
},
3860
"3": {
3861
"name": "constant.numeric.other.separator.thousands.cs"
3862
},
3863
"4": {
3864
"name": "constant.numeric.other.suffix.cs"
3865
}
3866
}
3867
},
3868
{
3869
"match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?((?:(?:(?:(?:(?:[uU]|[uU]l)|[uU]L)|l[uU]?)|L[uU]?)|[fFdDmM])(?!\\w))?$",
3870
"captures": {
3871
"2": {
3872
"name": "constant.numeric.decimal.cs",
3873
"patterns": [
3874
{
3875
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3876
"name": "constant.numeric.other.separator.thousands.cs"
3877
}
3878
]
3879
},
3880
"3": {
3881
"name": "constant.numeric.other.separator.thousands.cs"
3882
},
3883
"5": {
3884
"name": "constant.numeric.other.exponent.cs"
3885
},
3886
"6": {
3887
"name": "keyword.operator.arithmetic.cs"
3888
},
3889
"7": {
3890
"name": "keyword.operator.arithmetic.cs"
3891
},
3892
"8": {
3893
"name": "constant.numeric.decimal.cs",
3894
"patterns": [
3895
{
3896
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
3897
"name": "constant.numeric.other.separator.thousands.cs"
3898
}
3899
]
3900
},
3901
"9": {
3902
"name": "constant.numeric.other.suffix.cs"
3903
}
3904
}
3905
},
3906
{
3907
"match": "(?:(?:[0-9a-zA-Z_]|_)|(?<=[eE])[+-]|\\.\\d)+",
3908
"name": "invalid.illegal.constant.numeric.cs"
3909
}
3910
]
3911
}
3912
]
3913
}
3914
}
3915
},
3916
"char-literal": {
3917
"name": "string.quoted.single.cs",
3918
"begin": "'",
3919
"beginCaptures": {
3920
"0": {
3921
"name": "punctuation.definition.char.begin.cs"
3922
}
3923
},
3924
"end": "(\\')|((?:[^\\\\\\n])$)",
3925
"endCaptures": {
3926
"1": {
3927
"name": "punctuation.definition.char.end.cs"
3928
},
3929
"2": {
3930
"name": "invalid.illegal.newline.cs"
3931
}
3932
},
3933
"patterns": [
3934
{
3935
"include": "#char-character-escape"
3936
}
3937
]
3938
},
3939
"char-character-escape": {
3940
"name": "constant.character.escape.cs",
3941
"match": "\\\\(x[0-9a-fA-F]{1,4}|u[0-9a-fA-F]{4}|.)"
3942
},
3943
"string-literal": {
3944
"name": "string.quoted.double.cs",
3945
"begin": "(?<!@)\"",
3946
"beginCaptures": {
3947
"0": {
3948
"name": "punctuation.definition.string.begin.cs"
3949
}
3950
},
3951
"end": "(\")|((?:[^\\\\\\n])$)",
3952
"endCaptures": {
3953
"1": {
3954
"name": "punctuation.definition.string.end.cs"
3955
},
3956
"2": {
3957
"name": "invalid.illegal.newline.cs"
3958
}
3959
},
3960
"patterns": [
3961
{
3962
"include": "#string-character-escape"
3963
}
3964
]
3965
},
3966
"string-character-escape": {
3967
"name": "constant.character.escape.cs",
3968
"match": "\\\\(x[0-9a-fA-F]{1,4}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|.)"
3969
},
3970
"verbatim-string-literal": {
3971
"name": "string.quoted.double.cs",
3972
"begin": "@\"",
3973
"beginCaptures": {
3974
"0": {
3975
"name": "punctuation.definition.string.begin.cs"
3976
}
3977
},
3978
"end": "\"(?=[^\"])",
3979
"endCaptures": {
3980
"0": {
3981
"name": "punctuation.definition.string.end.cs"
3982
}
3983
},
3984
"patterns": [
3985
{
3986
"include": "#verbatim-string-character-escape"
3987
}
3988
]
3989
},
3990
"verbatim-string-character-escape": {
3991
"name": "constant.character.escape.cs",
3992
"match": "\"\""
3993
},
3994
"raw-string-literal": {
3995
"patterns": [
3996
{
3997
"include": "#raw-string-literal-more"
3998
},
3999
{
4000
"include": "#raw-string-literal-quadruple"
4001
},
4002
{
4003
"include": "#raw-string-literal-triple"
4004
}
4005
]
4006
},
4007
"raw-string-literal-triple": {
4008
"name": "string.quoted.double.cs",
4009
"begin": "\"\"\"",
4010
"beginCaptures": {
4011
"0": {
4012
"name": "punctuation.definition.string.begin.cs"
4013
}
4014
},
4015
"end": "\"\"\"",
4016
"endCaptures": {
4017
"0": {
4018
"name": "punctuation.definition.string.end.cs"
4019
}
4020
}
4021
},
4022
"raw-string-literal-quadruple": {
4023
"name": "string.quoted.double.cs",
4024
"begin": "\"\"\"\"",
4025
"beginCaptures": {
4026
"0": {
4027
"name": "punctuation.definition.string.begin.cs"
4028
}
4029
},
4030
"end": "\"\"\"\"",
4031
"endCaptures": {
4032
"0": {
4033
"name": "punctuation.definition.string.end.cs"
4034
}
4035
}
4036
},
4037
"raw-string-literal-more": {
4038
"name": "string.quoted.double.cs",
4039
"begin": "\"\"\"\"\"+",
4040
"beginCaptures": {
4041
"0": {
4042
"name": "punctuation.definition.string.begin.cs"
4043
}
4044
},
4045
"end": "\"\"\"\"\"+",
4046
"endCaptures": {
4047
"0": {
4048
"name": "punctuation.definition.string.end.cs"
4049
}
4050
}
4051
},
4052
"tuple-literal": {
4053
"begin": "(\\()(?=.*[:,])",
4054
"beginCaptures": {
4055
"1": {
4056
"name": "punctuation.parenthesis.open.cs"
4057
}
4058
},
4059
"end": "\\)",
4060
"endCaptures": {
4061
"0": {
4062
"name": "punctuation.parenthesis.close.cs"
4063
}
4064
},
4065
"patterns": [
4066
{
4067
"include": "#comment"
4068
},
4069
{
4070
"include": "#tuple-literal-element"
4071
},
4072
{
4073
"include": "#expression"
4074
},
4075
{
4076
"include": "#punctuation-comma"
4077
}
4078
]
4079
},
4080
"tuple-literal-element": {
4081
"begin": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*\n(?=:)",
4082
"beginCaptures": {
4083
"1": {
4084
"name": "entity.name.variable.tuple-element.cs"
4085
}
4086
},
4087
"end": "(:)",
4088
"endCaptures": {
4089
"0": {
4090
"name": "punctuation.separator.colon.cs"
4091
}
4092
}
4093
},
4094
"assignment-expression": {
4095
"begin": "(?:\\*|/|%|\\+|-|\\?\\?|\\&|\\^|<<|>>>?|\\|)?=(?!=|>)",
4096
"beginCaptures": {
4097
"0": {
4098
"patterns": [
4099
{
4100
"include": "#assignment-operators"
4101
}
4102
]
4103
}
4104
},
4105
"end": "(?=[,\\)\\];}])",
4106
"patterns": [
4107
{
4108
"include": "#ref-modifier"
4109
},
4110
{
4111
"include": "#expression"
4112
}
4113
]
4114
},
4115
"assignment-operators": {
4116
"patterns": [
4117
{
4118
"name": "keyword.operator.assignment.compound.cs",
4119
"match": "\\*=|/=|%=|\\+=|-=|\\?\\?="
4120
},
4121
{
4122
"name": "keyword.operator.assignment.compound.bitwise.cs",
4123
"match": "\\&=|\\^=|<<=|>>>?=|\\|="
4124
},
4125
{
4126
"name": "keyword.operator.assignment.cs",
4127
"match": "\\="
4128
}
4129
]
4130
},
4131
"expression-operators": {
4132
"patterns": [
4133
{
4134
"name": "keyword.operator.bitwise.shift.cs",
4135
"match": "<<|>>>?"
4136
},
4137
{
4138
"name": "keyword.operator.comparison.cs",
4139
"match": "==|!="
4140
},
4141
{
4142
"name": "keyword.operator.relational.cs",
4143
"match": "<=|>=|<|>"
4144
},
4145
{
4146
"name": "keyword.operator.logical.cs",
4147
"match": "\\!|&&|\\|\\|"
4148
},
4149
{
4150
"name": "keyword.operator.bitwise.cs",
4151
"match": "\\&|~|\\^|\\|"
4152
},
4153
{
4154
"name": "keyword.operator.decrement.cs",
4155
"match": "--"
4156
},
4157
{
4158
"name": "keyword.operator.increment.cs",
4159
"match": "\\+\\+"
4160
},
4161
{
4162
"name": "keyword.operator.arithmetic.cs",
4163
"match": "\\+|-(?!>)|\\*|/|%"
4164
},
4165
{
4166
"name": "keyword.operator.null-coalescing.cs",
4167
"match": "\\?\\?"
4168
},
4169
{
4170
"name": "keyword.operator.range.cs",
4171
"match": "\\.\\."
4172
}
4173
]
4174
},
4175
"with-expression": {
4176
"begin": "(?<!\\.)\\b(with)\\b\\s*(?=\\{|//|/\\*|$)",
4177
"beginCaptures": {
4178
"1": {
4179
"name": "keyword.operator.expression.with.cs"
4180
}
4181
},
4182
"end": "(?<=\\})",
4183
"patterns": [
4184
{
4185
"include": "#comment"
4186
},
4187
{
4188
"include": "#initializer-expression"
4189
}
4190
]
4191
},
4192
"conditional-operator": {
4193
"patterns": [
4194
{
4195
"name": "keyword.operator.conditional.question-mark.cs",
4196
"match": "\\?(?!\\?|\\s*[.\\[])"
4197
},
4198
{
4199
"name": "keyword.operator.conditional.colon.cs",
4200
"match": ":"
4201
}
4202
]
4203
},
4204
"await-expression": {
4205
"name": "keyword.operator.expression.await.cs",
4206
"match": "(?<!\\.\\s*)\\b(await)\\b"
4207
},
4208
"parenthesized-expression": {
4209
"begin": "\\(",
4210
"beginCaptures": {
4211
"0": {
4212
"name": "punctuation.parenthesis.open.cs"
4213
}
4214
},
4215
"end": "\\)",
4216
"endCaptures": {
4217
"0": {
4218
"name": "punctuation.parenthesis.close.cs"
4219
}
4220
},
4221
"patterns": [
4222
{
4223
"include": "#expression"
4224
}
4225
]
4226
},
4227
"initializer-expression": {
4228
"begin": "\\{",
4229
"beginCaptures": {
4230
"0": {
4231
"name": "punctuation.curlybrace.open.cs"
4232
}
4233
},
4234
"end": "\\}",
4235
"endCaptures": {
4236
"0": {
4237
"name": "punctuation.curlybrace.close.cs"
4238
}
4239
},
4240
"patterns": [
4241
{
4242
"include": "#expression"
4243
},
4244
{
4245
"include": "#punctuation-comma"
4246
}
4247
]
4248
},
4249
"identifier": {
4250
"name": "variable.other.readwrite.cs",
4251
"match": "@?[_[:alpha:]][_[:alnum:]]*"
4252
},
4253
"cast-expression": {
4254
"match": "(?x)\n(\\()\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(\\))(?=\\s*-*!*@?[_[:alnum:]\\(])",
4255
"captures": {
4256
"1": {
4257
"name": "punctuation.parenthesis.open.cs"
4258
},
4259
"2": {
4260
"patterns": [
4261
{
4262
"include": "#type"
4263
}
4264
]
4265
},
4266
"7": {
4267
"name": "punctuation.parenthesis.close.cs"
4268
}
4269
}
4270
},
4271
"as-expression": {
4272
"match": "(?x)\n(?<!\\.)\\b(as)\\b\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?(?!\\?))? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n \\s*(?:,\\s*)* # commata for multi-dimensional arrays\n \\]\n (?:\\s*\\?(?!\\?))? # arrays can be nullable reference types\n )*\n )\n)?",
4273
"captures": {
4274
"1": {
4275
"name": "keyword.operator.expression.as.cs"
4276
},
4277
"2": {
4278
"patterns": [
4279
{
4280
"include": "#type"
4281
}
4282
]
4283
}
4284
}
4285
},
4286
"language-variable": {
4287
"patterns": [
4288
{
4289
"name": "variable.language.$1.cs",
4290
"match": "\\b(base|this)\\b"
4291
},
4292
{
4293
"name": "variable.other.$1.cs",
4294
"match": "\\b(value)\\b"
4295
}
4296
]
4297
},
4298
"invocation-expression": {
4299
"begin": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(\n <\n (?<type_args>\n [^<>()]|\n \\((?:[^<>()]|<[^<>()]*>|\\([^<>()]*\\))*\\)|\n <\\g<type_args>*>\n )*\n >\\s*\n)? # type arguments\n(?=\\() # open paren of argument list",
4300
"beginCaptures": {
4301
"1": {
4302
"name": "keyword.operator.null-conditional.cs"
4303
},
4304
"2": {
4305
"name": "punctuation.accessor.cs"
4306
},
4307
"3": {
4308
"name": "punctuation.accessor.pointer.cs"
4309
},
4310
"4": {
4311
"name": "entity.name.function.cs"
4312
},
4313
"5": {
4314
"patterns": [
4315
{
4316
"include": "#type-arguments"
4317
}
4318
]
4319
}
4320
},
4321
"end": "(?<=\\))",
4322
"patterns": [
4323
{
4324
"include": "#argument-list"
4325
}
4326
]
4327
},
4328
"element-access-expression": {
4329
"begin": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list",
4330
"beginCaptures": {
4331
"1": {
4332
"name": "keyword.operator.null-conditional.cs"
4333
},
4334
"2": {
4335
"name": "punctuation.accessor.cs"
4336
},
4337
"3": {
4338
"name": "punctuation.accessor.pointer.cs"
4339
},
4340
"4": {
4341
"name": "variable.other.object.property.cs"
4342
},
4343
"5": {
4344
"name": "keyword.operator.null-conditional.cs"
4345
}
4346
},
4347
"end": "(?<=\\])(?!\\s*\\[)",
4348
"patterns": [
4349
{
4350
"include": "#bracketed-argument-list"
4351
}
4352
]
4353
},
4354
"member-access-expression": {
4355
"patterns": [
4356
{
4357
"match": "(?x)\n(?:\n (?:(\\?)\\s*)? # preceding null-conditional operator?\n (\\.)\\s*| # preceding dot?\n (->)\\s* # preceding pointer arrow?\n)\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[",
4358
"captures": {
4359
"1": {
4360
"name": "keyword.operator.null-conditional.cs"
4361
},
4362
"2": {
4363
"name": "punctuation.accessor.cs"
4364
},
4365
"3": {
4366
"name": "punctuation.accessor.pointer.cs"
4367
},
4368
"4": {
4369
"name": "variable.other.object.property.cs"
4370
}
4371
}
4372
},
4373
{
4374
"match": "(?x)\n(\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?<type_params>\\s*<([^<>]|\\g<type_params>)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
4375
"captures": {
4376
"1": {
4377
"name": "punctuation.accessor.cs"
4378
},
4379
"2": {
4380
"name": "variable.other.object.cs"
4381
},
4382
"3": {
4383
"patterns": [
4384
{
4385
"include": "#type-arguments"
4386
}
4387
]
4388
}
4389
}
4390
},
4391
{
4392
"match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n \\s*(?:(?:\\?\\s*)?\\.|->)\n \\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
4393
"captures": {
4394
"1": {
4395
"name": "variable.other.object.cs"
4396
}
4397
}
4398
}
4399
]
4400
},
4401
"object-creation-expression": {
4402
"patterns": [
4403
{
4404
"include": "#object-creation-expression-with-parameters"
4405
},
4406
{
4407
"include": "#object-creation-expression-with-no-parameters"
4408
}
4409
]
4410
},
4411
"object-creation-expression-with-parameters": {
4412
"begin": "(?x)\n(new)(?:\\s+\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n))?\\s*\n(?=\\()",
4413
"beginCaptures": {
4414
"1": {
4415
"name": "keyword.operator.expression.new.cs"
4416
},
4417
"2": {
4418
"patterns": [
4419
{
4420
"include": "#type"
4421
}
4422
]
4423
}
4424
},
4425
"end": "(?<=\\))",
4426
"patterns": [
4427
{
4428
"include": "#argument-list"
4429
}
4430
]
4431
},
4432
"object-creation-expression-with-no-parameters": {
4433
"match": "(?x)\n(new)\\s+\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(?=\\{|//|/\\*|$)",
4434
"captures": {
4435
"1": {
4436
"name": "keyword.operator.expression.new.cs"
4437
},
4438
"2": {
4439
"patterns": [
4440
{
4441
"include": "#type"
4442
}
4443
]
4444
}
4445
}
4446
},
4447
"array-creation-expression": {
4448
"begin": "(?x)\n\\b(new|stackalloc)\\b\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\\s*\n(?=\\[)",
4449
"beginCaptures": {
4450
"1": {
4451
"name": "keyword.operator.expression.$1.cs"
4452
},
4453
"2": {
4454
"patterns": [
4455
{
4456
"include": "#type"
4457
}
4458
]
4459
}
4460
},
4461
"end": "(?<=\\])",
4462
"patterns": [
4463
{
4464
"include": "#bracketed-argument-list"
4465
}
4466
]
4467
},
4468
"anonymous-object-creation-expression": {
4469
"begin": "\\b(new)\\b\\s*(?=\\{|//|/\\*|$)",
4470
"beginCaptures": {
4471
"1": {
4472
"name": "keyword.operator.expression.new.cs"
4473
}
4474
},
4475
"end": "(?<=\\})",
4476
"patterns": [
4477
{
4478
"include": "#comment"
4479
},
4480
{
4481
"include": "#initializer-expression"
4482
}
4483
]
4484
},
4485
"bracketed-parameter-list": {
4486
"begin": "(?=(\\[))",
4487
"beginCaptures": {
4488
"1": {
4489
"name": "punctuation.squarebracket.open.cs"
4490
}
4491
},
4492
"end": "(?=(\\]))",
4493
"endCaptures": {
4494
"1": {
4495
"name": "punctuation.squarebracket.close.cs"
4496
}
4497
},
4498
"patterns": [
4499
{
4500
"begin": "(?<=\\[)",
4501
"end": "(?=\\])",
4502
"patterns": [
4503
{
4504
"include": "#comment"
4505
},
4506
{
4507
"include": "#attribute-section"
4508
},
4509
{
4510
"include": "#parameter"
4511
},
4512
{
4513
"include": "#punctuation-comma"
4514
},
4515
{
4516
"include": "#variable-initializer"
4517
}
4518
]
4519
}
4520
]
4521
},
4522
"parenthesized-parameter-list": {
4523
"begin": "(\\()",
4524
"beginCaptures": {
4525
"0": {
4526
"name": "punctuation.parenthesis.open.cs"
4527
}
4528
},
4529
"end": "(\\))",
4530
"endCaptures": {
4531
"0": {
4532
"name": "punctuation.parenthesis.close.cs"
4533
}
4534
},
4535
"patterns": [
4536
{
4537
"include": "#comment"
4538
},
4539
{
4540
"include": "#attribute-section"
4541
},
4542
{
4543
"include": "#parameter"
4544
},
4545
{
4546
"include": "#punctuation-comma"
4547
},
4548
{
4549
"include": "#variable-initializer"
4550
}
4551
]
4552
},
4553
"parameter": {
4554
"match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?<type_name>\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^()]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s+\n(\\g<identifier>)",
4555
"captures": {
4556
"1": {
4557
"name": "storage.modifier.$1.cs"
4558
},
4559
"2": {
4560
"patterns": [
4561
{
4562
"include": "#type"
4563
}
4564
]
4565
},
4566
"7": {
4567
"name": "entity.name.variable.parameter.cs"
4568
}
4569
}
4570
},
4571
"argument-list": {
4572
"begin": "\\(",
4573
"beginCaptures": {
4574
"0": {
4575
"name": "punctuation.parenthesis.open.cs"
4576
}
4577
},
4578
"end": "\\)",
4579
"endCaptures": {
4580
"0": {
4581
"name": "punctuation.parenthesis.close.cs"
4582
}
4583
},
4584
"patterns": [
4585
{
4586
"include": "#named-argument"
4587
},
4588
{
4589
"include": "#argument"
4590
},
4591
{
4592
"include": "#punctuation-comma"
4593
}
4594
]
4595
},
4596
"bracketed-argument-list": {
4597
"begin": "\\[",
4598
"beginCaptures": {
4599
"0": {
4600
"name": "punctuation.squarebracket.open.cs"
4601
}
4602
},
4603
"end": "\\]",
4604
"endCaptures": {
4605
"0": {
4606
"name": "punctuation.squarebracket.close.cs"
4607
}
4608
},
4609
"patterns": [
4610
{
4611
"include": "#named-argument"
4612
},
4613
{
4614
"include": "#argument"
4615
},
4616
{
4617
"include": "#punctuation-comma"
4618
}
4619
]
4620
},
4621
"named-argument": {
4622
"begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
4623
"beginCaptures": {
4624
"1": {
4625
"name": "entity.name.variable.parameter.cs"
4626
},
4627
"2": {
4628
"name": "punctuation.separator.colon.cs"
4629
}
4630
},
4631
"end": "(?=(,|\\)|\\]))",
4632
"patterns": [
4633
{
4634
"include": "#argument"
4635
}
4636
]
4637
},
4638
"argument": {
4639
"patterns": [
4640
{
4641
"name": "storage.modifier.$1.cs",
4642
"match": "\\b(ref|in)\\b"
4643
},
4644
{
4645
"begin": "\\b(out)\\b",
4646
"beginCaptures": {
4647
"1": {
4648
"name": "storage.modifier.out.cs"
4649
}
4650
},
4651
"end": "(?=,|\\)|\\])",
4652
"patterns": [
4653
{
4654
"include": "#declaration-expression-local"
4655
},
4656
{
4657
"include": "#expression"
4658
}
4659
]
4660
},
4661
{
4662
"include": "#expression"
4663
}
4664
]
4665
},
4666
"query-expression": {
4667
"begin": "(?x)\n\\b(from)\\b\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\n\\s+(\\g<identifier>)\\b\\s*\n\\b(in)\\b\\s*",
4668
"beginCaptures": {
4669
"1": {
4670
"name": "keyword.operator.expression.query.from.cs"
4671
},
4672
"2": {
4673
"patterns": [
4674
{
4675
"include": "#type"
4676
}
4677
]
4678
},
4679
"7": {
4680
"name": "entity.name.variable.range-variable.cs"
4681
},
4682
"8": {
4683
"name": "keyword.operator.expression.query.in.cs"
4684
}
4685
},
4686
"end": "(?=;|\\))",
4687
"patterns": [
4688
{
4689
"include": "#query-body"
4690
},
4691
{
4692
"include": "#expression"
4693
}
4694
]
4695
},
4696
"query-body": {
4697
"patterns": [
4698
{
4699
"include": "#let-clause"
4700
},
4701
{
4702
"include": "#where-clause"
4703
},
4704
{
4705
"include": "#join-clause"
4706
},
4707
{
4708
"include": "#orderby-clause"
4709
},
4710
{
4711
"include": "#select-clause"
4712
},
4713
{
4714
"include": "#group-clause"
4715
}
4716
]
4717
},
4718
"let-clause": {
4719
"begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*",
4720
"beginCaptures": {
4721
"1": {
4722
"name": "keyword.operator.expression.query.let.cs"
4723
},
4724
"2": {
4725
"name": "entity.name.variable.range-variable.cs"
4726
},
4727
"3": {
4728
"name": "keyword.operator.assignment.cs"
4729
}
4730
},
4731
"end": "(?=;|\\))",
4732
"patterns": [
4733
{
4734
"include": "#query-body"
4735
},
4736
{
4737
"include": "#expression"
4738
}
4739
]
4740
},
4741
"where-clause": {
4742
"begin": "(?x)\n\\b(where)\\b\\s*",
4743
"beginCaptures": {
4744
"1": {
4745
"name": "keyword.operator.expression.query.where.cs"
4746
}
4747
},
4748
"end": "(?=;|\\))",
4749
"patterns": [
4750
{
4751
"include": "#query-body"
4752
},
4753
{
4754
"include": "#expression"
4755
}
4756
]
4757
},
4758
"join-clause": {
4759
"begin": "(?x)\n\\b(join)\\b\\s*\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)?\n\\s+(\\g<identifier>)\\b\\s*\n\\b(in)\\b\\s*",
4760
"beginCaptures": {
4761
"1": {
4762
"name": "keyword.operator.expression.query.join.cs"
4763
},
4764
"2": {
4765
"patterns": [
4766
{
4767
"include": "#type"
4768
}
4769
]
4770
},
4771
"7": {
4772
"name": "entity.name.variable.range-variable.cs"
4773
},
4774
"8": {
4775
"name": "keyword.operator.expression.query.in.cs"
4776
}
4777
},
4778
"end": "(?=;|\\))",
4779
"patterns": [
4780
{
4781
"include": "#join-on"
4782
},
4783
{
4784
"include": "#join-equals"
4785
},
4786
{
4787
"include": "#join-into"
4788
},
4789
{
4790
"include": "#query-body"
4791
},
4792
{
4793
"include": "#expression"
4794
}
4795
]
4796
},
4797
"join-on": {
4798
"match": "\\b(on)\\b\\s*",
4799
"captures": {
4800
"1": {
4801
"name": "keyword.operator.expression.query.on.cs"
4802
}
4803
}
4804
},
4805
"join-equals": {
4806
"match": "\\b(equals)\\b\\s*",
4807
"captures": {
4808
"1": {
4809
"name": "keyword.operator.expression.query.equals.cs"
4810
}
4811
}
4812
},
4813
"join-into": {
4814
"match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
4815
"captures": {
4816
"1": {
4817
"name": "keyword.operator.expression.query.into.cs"
4818
},
4819
"2": {
4820
"name": "entity.name.variable.range-variable.cs"
4821
}
4822
}
4823
},
4824
"orderby-clause": {
4825
"begin": "\\b(orderby)\\b\\s*",
4826
"beginCaptures": {
4827
"1": {
4828
"name": "keyword.operator.expression.query.orderby.cs"
4829
}
4830
},
4831
"end": "(?=;|\\))",
4832
"patterns": [
4833
{
4834
"include": "#ordering-direction"
4835
},
4836
{
4837
"include": "#query-body"
4838
},
4839
{
4840
"include": "#expression"
4841
},
4842
{
4843
"include": "#punctuation-comma"
4844
}
4845
]
4846
},
4847
"ordering-direction": {
4848
"match": "\\b(ascending|descending)\\b",
4849
"captures": {
4850
"1": {
4851
"name": "keyword.operator.expression.query.$1.cs"
4852
}
4853
}
4854
},
4855
"select-clause": {
4856
"begin": "\\b(select)\\b\\s*",
4857
"beginCaptures": {
4858
"1": {
4859
"name": "keyword.operator.expression.query.select.cs"
4860
}
4861
},
4862
"end": "(?=;|\\))",
4863
"patterns": [
4864
{
4865
"include": "#query-body"
4866
},
4867
{
4868
"include": "#expression"
4869
}
4870
]
4871
},
4872
"group-clause": {
4873
"begin": "\\b(group)\\b\\s*",
4874
"beginCaptures": {
4875
"1": {
4876
"name": "keyword.operator.expression.query.group.cs"
4877
}
4878
},
4879
"end": "(?=;|\\))",
4880
"patterns": [
4881
{
4882
"include": "#group-by"
4883
},
4884
{
4885
"include": "#group-into"
4886
},
4887
{
4888
"include": "#query-body"
4889
},
4890
{
4891
"include": "#expression"
4892
}
4893
]
4894
},
4895
"group-by": {
4896
"match": "\\b(by)\\b\\s*",
4897
"captures": {
4898
"1": {
4899
"name": "keyword.operator.expression.query.by.cs"
4900
}
4901
}
4902
},
4903
"group-into": {
4904
"match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
4905
"captures": {
4906
"1": {
4907
"name": "keyword.operator.expression.query.into.cs"
4908
},
4909
"2": {
4910
"name": "entity.name.variable.range-variable.cs"
4911
}
4912
}
4913
},
4914
"anonymous-method-expression": {
4915
"patterns": [
4916
{
4917
"begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\b|\n (\\()\n (?<tuple>(?:[^()]|\\(\\g<tuple>\\))*)\n (\\))\n)\\s*\n(=>)",
4918
"beginCaptures": {
4919
"1": {
4920
"patterns": [
4921
{
4922
"match": "async|static",
4923
"name": "storage.modifier.$0.cs"
4924
}
4925
]
4926
},
4927
"2": {
4928
"name": "entity.name.variable.parameter.cs"
4929
},
4930
"3": {
4931
"name": "punctuation.parenthesis.open.cs"
4932
},
4933
"4": {
4934
"patterns": [
4935
{
4936
"include": "#comment"
4937
},
4938
{
4939
"include": "#explicit-anonymous-function-parameter"
4940
},
4941
{
4942
"include": "#implicit-anonymous-function-parameter"
4943
},
4944
{
4945
"include": "#default-argument"
4946
},
4947
{
4948
"include": "#punctuation-comma"
4949
}
4950
]
4951
},
4952
"5": {
4953
"name": "punctuation.parenthesis.close.cs"
4954
},
4955
"6": {
4956
"name": "keyword.operator.arrow.cs"
4957
}
4958
},
4959
"end": "(?=[,;)}])",
4960
"patterns": [
4961
{
4962
"include": "#intrusive"
4963
},
4964
{
4965
"begin": "(?={)",
4966
"end": "(?=[,;)}])",
4967
"patterns": [
4968
{
4969
"include": "#block"
4970
},
4971
{
4972
"include": "#intrusive"
4973
}
4974
]
4975
},
4976
{
4977
"begin": "\\b(ref)\\b|(?=\\S)",
4978
"beginCaptures": {
4979
"1": {
4980
"name": "storage.modifier.ref.cs"
4981
}
4982
},
4983
"end": "(?=[,;)}])",
4984
"patterns": [
4985
{
4986
"include": "#expression"
4987
}
4988
]
4989
}
4990
]
4991
},
4992
{
4993
"begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n\\b(delegate)\\b\\s*",
4994
"beginCaptures": {
4995
"1": {
4996
"patterns": [
4997
{
4998
"match": "async|static",
4999
"name": "storage.modifier.$0.cs"
5000
}
5001
]
5002
},
5003
"2": {
5004
"name": "storage.type.delegate.cs"
5005
}
5006
},
5007
"end": "(?<=})|(?=[,;)}])",
5008
"patterns": [
5009
{
5010
"include": "#intrusive"
5011
},
5012
{
5013
"begin": "\\(",
5014
"beginCaptures": {
5015
"0": {
5016
"name": "punctuation.parenthesis.open.cs"
5017
}
5018
},
5019
"end": "\\)",
5020
"endCaptures": {
5021
"0": {
5022
"name": "punctuation.parenthesis.close.cs"
5023
}
5024
},
5025
"patterns": [
5026
{
5027
"include": "#intrusive"
5028
},
5029
{
5030
"include": "#explicit-anonymous-function-parameter"
5031
},
5032
{
5033
"include": "#punctuation-comma"
5034
}
5035
]
5036
},
5037
{
5038
"include": "#block"
5039
}
5040
]
5041
}
5042
]
5043
},
5044
"explicit-anonymous-function-parameter": {
5045
"match": "(?x)\n(?:\\b(ref|params|out|in)\\b\\s*)?\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args><(?:[^<>]|\\g<type_args>)*>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^()]|\\g<tuple>)*\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n\\b(\\g<identifier>)\\b",
5046
"captures": {
5047
"1": {
5048
"name": "storage.modifier.$1.cs"
5049
},
5050
"2": {
5051
"patterns": [
5052
{
5053
"include": "#type"
5054
}
5055
]
5056
},
5057
"7": {
5058
"name": "entity.name.variable.parameter.cs"
5059
}
5060
}
5061
},
5062
"implicit-anonymous-function-parameter": {
5063
"match": "\\@?[_[:alpha:]][_[:alnum:]]*\\b",
5064
"name": "entity.name.variable.parameter.cs"
5065
},
5066
"default-argument": {
5067
"begin": "=",
5068
"beginCaptures": {
5069
"0": {
5070
"name": "keyword.operator.assignment.cs"
5071
}
5072
},
5073
"end": "(?=,|\\))",
5074
"patterns": [
5075
{
5076
"include": "#expression"
5077
}
5078
]
5079
},
5080
"type": {
5081
"patterns": [
5082
{
5083
"include": "#comment"
5084
},
5085
{
5086
"include": "#ref-modifier"
5087
},
5088
{
5089
"include": "#readonly-modifier"
5090
},
5091
{
5092
"include": "#tuple-type"
5093
},
5094
{
5095
"include": "#type-builtin"
5096
},
5097
{
5098
"include": "#type-name"
5099
},
5100
{
5101
"include": "#type-arguments"
5102
},
5103
{
5104
"include": "#type-array-suffix"
5105
},
5106
{
5107
"include": "#type-nullable-suffix"
5108
},
5109
{
5110
"include": "#type-pointer-suffix"
5111
}
5112
]
5113
},
5114
"ref-modifier": {
5115
"name": "storage.modifier.ref.cs",
5116
"match": "\\bref\\b"
5117
},
5118
"readonly-modifier": {
5119
"name": "storage.modifier.readonly.cs",
5120
"match": "\\breadonly\\b"
5121
},
5122
"tuple-type": {
5123
"begin": "\\(",
5124
"beginCaptures": {
5125
"0": {
5126
"name": "punctuation.parenthesis.open.cs"
5127
}
5128
},
5129
"end": "\\)",
5130
"endCaptures": {
5131
"0": {
5132
"name": "punctuation.parenthesis.close.cs"
5133
}
5134
},
5135
"patterns": [
5136
{
5137
"include": "#tuple-element"
5138
},
5139
{
5140
"include": "#punctuation-comma"
5141
}
5142
]
5143
},
5144
"tuple-element": {
5145
"match": "(?x)\n(?<type_name>\n (?:\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name_and_type_args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name_and_type_args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\n(?:(?<tuple_name>\\g<identifier>)\\b)?",
5146
"captures": {
5147
"1": {
5148
"patterns": [
5149
{
5150
"include": "#type"
5151
}
5152
]
5153
},
5154
"6": {
5155
"name": "entity.name.variable.tuple-element.cs"
5156
}
5157
}
5158
},
5159
"type-builtin": {
5160
"match": "\\b(bool|s?byte|u?short|n?u?int|u?long|float|double|decimal|char|string|object|void|dynamic)\\b",
5161
"captures": {
5162
"1": {
5163
"name": "keyword.type.$1.cs"
5164
}
5165
}
5166
},
5167
"type-name": {
5168
"patterns": [
5169
{
5170
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)",
5171
"captures": {
5172
"1": {
5173
"name": "entity.name.type.alias.cs"
5174
},
5175
"2": {
5176
"name": "punctuation.separator.coloncolon.cs"
5177
}
5178
}
5179
},
5180
{
5181
"match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)",
5182
"captures": {
5183
"1": {
5184
"name": "entity.name.type.cs"
5185
},
5186
"2": {
5187
"name": "punctuation.accessor.cs"
5188
}
5189
}
5190
},
5191
{
5192
"match": "(\\.)\\s*(@?[_[:alpha:]][_[:alnum:]]*)",
5193
"captures": {
5194
"1": {
5195
"name": "punctuation.accessor.cs"
5196
},
5197
"2": {
5198
"name": "entity.name.type.cs"
5199
}
5200
}
5201
},
5202
{
5203
"name": "entity.name.type.cs",
5204
"match": "@?[_[:alpha:]][_[:alnum:]]*"
5205
}
5206
]
5207
},
5208
"type-arguments": {
5209
"begin": "<",
5210
"beginCaptures": {
5211
"0": {
5212
"name": "punctuation.definition.typeparameters.begin.cs"
5213
}
5214
},
5215
"end": ">",
5216
"endCaptures": {
5217
"0": {
5218
"name": "punctuation.definition.typeparameters.end.cs"
5219
}
5220
},
5221
"patterns": [
5222
{
5223
"include": "#type"
5224
},
5225
{
5226
"include": "#punctuation-comma"
5227
}
5228
]
5229
},
5230
"type-array-suffix": {
5231
"begin": "\\[",
5232
"beginCaptures": {
5233
"0": {
5234
"name": "punctuation.squarebracket.open.cs"
5235
}
5236
},
5237
"end": "\\]",
5238
"endCaptures": {
5239
"0": {
5240
"name": "punctuation.squarebracket.close.cs"
5241
}
5242
},
5243
"patterns": [
5244
{
5245
"include": "#intrusive"
5246
},
5247
{
5248
"include": "#punctuation-comma"
5249
}
5250
]
5251
},
5252
"type-nullable-suffix": {
5253
"match": "\\?",
5254
"name": "punctuation.separator.question-mark.cs"
5255
},
5256
"type-pointer-suffix": {
5257
"match": "\\*",
5258
"name": "punctuation.separator.asterisk.cs"
5259
},
5260
"operator-assignment": {
5261
"name": "keyword.operator.assignment.cs",
5262
"match": "(?<!=|!)(=)(?!=)"
5263
},
5264
"punctuation-comma": {
5265
"name": "punctuation.separator.comma.cs",
5266
"match": ","
5267
},
5268
"punctuation-semicolon": {
5269
"name": "punctuation.terminator.statement.cs",
5270
"match": ";"
5271
},
5272
"punctuation-accessor": {
5273
"name": "punctuation.accessor.cs",
5274
"match": "\\."
5275
},
5276
"intrusive": {
5277
"patterns": [
5278
{
5279
"include": "#preprocessor"
5280
},
5281
{
5282
"include": "#comment"
5283
}
5284
]
5285
},
5286
"preprocessor": {
5287
"name": "meta.preprocessor.cs",
5288
"begin": "^\\s*(\\#)\\s*",
5289
"beginCaptures": {
5290
"1": {
5291
"name": "punctuation.separator.hash.cs"
5292
}
5293
},
5294
"end": "(?<=$)",
5295
"patterns": [
5296
{
5297
"include": "#preprocessor-comment"
5298
},
5299
{
5300
"include": "#preprocessor-define-or-undef"
5301
},
5302
{
5303
"include": "#preprocessor-if-or-elif"
5304
},
5305
{
5306
"include": "#preprocessor-else-or-endif"
5307
},
5308
{
5309
"include": "#preprocessor-warning-or-error"
5310
},
5311
{
5312
"include": "#preprocessor-region"
5313
},
5314
{
5315
"include": "#preprocessor-endregion"
5316
},
5317
{
5318
"include": "#preprocessor-load"
5319
},
5320
{
5321
"include": "#preprocessor-r"
5322
},
5323
{
5324
"include": "#preprocessor-line"
5325
},
5326
{
5327
"include": "#preprocessor-pragma-warning"
5328
},
5329
{
5330
"include": "#preprocessor-pragma-checksum"
5331
},
5332
{
5333
"include": "#preprocessor-app-directive"
5334
}
5335
]
5336
},
5337
"preprocessor-comment": {
5338
"patterns": [
5339
{
5340
"name": "comment.line.double-slash.cs",
5341
"match": "(//).*(?=$)",
5342
"captures": {
5343
"1": {
5344
"name": "punctuation.definition.comment.cs"
5345
}
5346
}
5347
},
5348
{
5349
"name": "comment.block.cs",
5350
"begin": "/\\*",
5351
"end": "\\*/",
5352
"captures": {
5353
"0": {
5354
"name": "punctuation.definition.comment.cs"
5355
}
5356
}
5357
}
5358
]
5359
},
5360
"preprocessor-define-or-undef": {
5361
"match": "\\b(?:(define)|(undef))\\b\\s*\\b([_[:alpha:]][_[:alnum:]]*)\\b",
5362
"captures": {
5363
"1": {
5364
"name": "keyword.preprocessor.define.cs"
5365
},
5366
"2": {
5367
"name": "keyword.preprocessor.undef.cs"
5368
},
5369
"3": {
5370
"name": "entity.name.variable.preprocessor.symbol.cs"
5371
}
5372
}
5373
},
5374
"preprocessor-if-or-elif": {
5375
"begin": "\\b(?:(if)|(elif))\\b",
5376
"beginCaptures": {
5377
"1": {
5378
"name": "keyword.preprocessor.if.cs"
5379
},
5380
"2": {
5381
"name": "keyword.preprocessor.elif.cs"
5382
}
5383
},
5384
"end": "(?=$)",
5385
"patterns": [
5386
{
5387
"include": "#preprocessor-comment"
5388
},
5389
{
5390
"include": "#preprocessor-expression"
5391
}
5392
]
5393
},
5394
"preprocessor-else-or-endif": {
5395
"match": "\\b(?:(else)|(endif))\\b",
5396
"captures": {
5397
"1": {
5398
"name": "keyword.preprocessor.else.cs"
5399
},
5400
"2": {
5401
"name": "keyword.preprocessor.endif.cs"
5402
}
5403
}
5404
},
5405
"preprocessor-warning-or-error": {
5406
"match": "\\b(?:(warning)|(error))\\b\\s*(.*)(?=$)",
5407
"captures": {
5408
"1": {
5409
"name": "keyword.preprocessor.warning.cs"
5410
},
5411
"2": {
5412
"name": "keyword.preprocessor.error.cs"
5413
},
5414
"3": {
5415
"name": "string.unquoted.preprocessor.message.cs"
5416
}
5417
}
5418
},
5419
"preprocessor-load": {
5420
"begin": "\\b(load)\\b",
5421
"beginCaptures": {
5422
"1": {
5423
"name": "keyword.preprocessor.load.cs"
5424
}
5425
},
5426
"end": "(?=$)",
5427
"patterns": [
5428
{
5429
"match": "\\\"[^\"]*\\\"",
5430
"captures": {
5431
"0": {
5432
"name": "string.quoted.double.cs"
5433
}
5434
}
5435
}
5436
]
5437
},
5438
"preprocessor-r": {
5439
"begin": "\\b(r)\\b",
5440
"beginCaptures": {
5441
"1": {
5442
"name": "keyword.preprocessor.r.cs"
5443
}
5444
},
5445
"end": "(?=$)",
5446
"patterns": [
5447
{
5448
"match": "\\\"[^\"]*\\\"",
5449
"captures": {
5450
"0": {
5451
"name": "string.quoted.double.cs"
5452
}
5453
}
5454
}
5455
]
5456
},
5457
"preprocessor-region": {
5458
"match": "\\b(region)\\b\\s*(.*)(?=$)",
5459
"captures": {
5460
"1": {
5461
"name": "keyword.preprocessor.region.cs"
5462
},
5463
"2": {
5464
"name": "string.unquoted.preprocessor.message.cs"
5465
}
5466
}
5467
},
5468
"preprocessor-endregion": {
5469
"match": "\\b(endregion)\\b",
5470
"captures": {
5471
"1": {
5472
"name": "keyword.preprocessor.endregion.cs"
5473
}
5474
}
5475
},
5476
"preprocessor-line": {
5477
"begin": "\\b(line)\\b",
5478
"beginCaptures": {
5479
"1": {
5480
"name": "keyword.preprocessor.line.cs"
5481
}
5482
},
5483
"end": "(?=$)",
5484
"patterns": [
5485
{
5486
"match": "\\b(?:(default|hidden))",
5487
"captures": {
5488
"1": {
5489
"name": "keyword.preprocessor.default.cs"
5490
},
5491
"2": {
5492
"name": "keyword.preprocessor.hidden.cs"
5493
}
5494
}
5495
},
5496
{
5497
"match": "[0-9]+",
5498
"captures": {
5499
"0": {
5500
"name": "constant.numeric.decimal.cs"
5501
}
5502
}
5503
},
5504
{
5505
"match": "\\\"[^\"]*\\\"",
5506
"captures": {
5507
"0": {
5508
"name": "string.quoted.double.cs"
5509
}
5510
}
5511
}
5512
]
5513
},
5514
"preprocessor-pragma-warning": {
5515
"match": "\\b(pragma)\\b\\s*\\b(warning)\\b\\s*\\b(?:(disable)|(restore))\\b(\\s*[0-9]+(?:\\s*,\\s*[0-9]+)?)?",
5516
"captures": {
5517
"1": {
5518
"name": "keyword.preprocessor.pragma.cs"
5519
},
5520
"2": {
5521
"name": "keyword.preprocessor.warning.cs"
5522
},
5523
"3": {
5524
"name": "keyword.preprocessor.disable.cs"
5525
},
5526
"4": {
5527
"name": "keyword.preprocessor.restore.cs"
5528
},
5529
"5": {
5530
"patterns": [
5531
{
5532
"match": "[0-9]+",
5533
"captures": {
5534
"0": {
5535
"name": "constant.numeric.decimal.cs"
5536
}
5537
}
5538
},
5539
{
5540
"include": "#punctuation-comma"
5541
}
5542
]
5543
}
5544
}
5545
},
5546
"preprocessor-pragma-checksum": {
5547
"match": "\\b(pragma)\\b\\s*\\b(checksum)\\b\\s*(\\\"[^\"]*\\\")\\s*(\\\"[^\"]*\\\")\\s*(\\\"[^\"]*\\\")",
5548
"captures": {
5549
"1": {
5550
"name": "keyword.preprocessor.pragma.cs"
5551
},
5552
"2": {
5553
"name": "keyword.preprocessor.checksum.cs"
5554
},
5555
"3": {
5556
"name": "string.quoted.double.cs"
5557
},
5558
"4": {
5559
"name": "string.quoted.double.cs"
5560
},
5561
"5": {
5562
"name": "string.quoted.double.cs"
5563
}
5564
}
5565
},
5566
"preprocessor-app-directive": {
5567
"begin": "\\s*(:)\\s*",
5568
"beginCaptures": {
5569
"1": {
5570
"name": "punctuation.separator.colon.cs"
5571
}
5572
},
5573
"end": "(?=$)",
5574
"patterns": [
5575
{
5576
"include": "#preprocessor-app-directive-package"
5577
},
5578
{
5579
"include": "#preprocessor-app-directive-property"
5580
},
5581
{
5582
"include": "#preprocessor-app-directive-project"
5583
},
5584
{
5585
"include": "#preprocessor-app-directive-sdk"
5586
},
5587
{
5588
"include": "#preprocessor-app-directive-generic"
5589
}
5590
]
5591
},
5592
"preprocessor-app-directive-package": {
5593
"match": "\\b(package)\\b\\s*([_[:alpha:]][_.[:alnum:]]*)?(@)?(.*)?\\s*",
5594
"captures": {
5595
"1": {
5596
"name": "keyword.preprocessor.package.cs"
5597
},
5598
"2": {
5599
"patterns": [
5600
{
5601
"include": "#preprocessor-app-directive-package-name"
5602
}
5603
]
5604
},
5605
"3": {
5606
"name": "punctuation.separator.at.cs"
5607
},
5608
"4": {
5609
"name": "string.unquoted.preprocessor.message.cs"
5610
}
5611
}
5612
},
5613
"preprocessor-app-directive-property": {
5614
"match": "\\b(property)\\b\\s*([_[:alpha:]][_[:alnum:]]*)?(=)?(.*)?\\s*",
5615
"captures": {
5616
"1": {
5617
"name": "keyword.preprocessor.property.cs"
5618
},
5619
"2": {
5620
"name": "entity.name.variable.preprocessor.symbol.cs"
5621
},
5622
"3": {
5623
"name": "punctuation.separator.equals.cs"
5624
},
5625
"4": {
5626
"name": "string.unquoted.preprocessor.message.cs"
5627
}
5628
}
5629
},
5630
"preprocessor-app-directive-project": {
5631
"match": "\\b(project)\\b\\s*(.*)?\\s*",
5632
"captures": {
5633
"1": {
5634
"name": "keyword.preprocessor.project.cs"
5635
},
5636
"2": {
5637
"name": "string.unquoted.preprocessor.message.cs"
5638
}
5639
}
5640
},
5641
"preprocessor-app-directive-sdk": {
5642
"match": "\\b(sdk)\\b\\s*([_[:alpha:]][_.[:alnum:]]*)?(@)?(.*)?\\s*",
5643
"captures": {
5644
"1": {
5645
"name": "keyword.preprocessor.sdk.cs"
5646
},
5647
"2": {
5648
"patterns": [
5649
{
5650
"include": "#preprocessor-app-directive-package-name"
5651
}
5652
]
5653
},
5654
"3": {
5655
"name": "punctuation.separator.at.cs"
5656
},
5657
"4": {
5658
"name": "string.unquoted.preprocessor.message.cs"
5659
}
5660
}
5661
},
5662
"preprocessor-app-directive-package-name": {
5663
"patterns": [
5664
{
5665
"match": "(\\.)([_[:alpha:]][_[:alnum:]]*)",
5666
"captures": {
5667
"1": {
5668
"name": "punctuation.dot.cs"
5669
},
5670
"2": {
5671
"name": "entity.name.variable.preprocessor.symbol.cs"
5672
}
5673
}
5674
},
5675
{
5676
"name": "entity.name.variable.preprocessor.symbol.cs",
5677
"match": "[_[:alpha:]][_[:alnum:]]*"
5678
}
5679
]
5680
},
5681
"preprocessor-app-directive-generic": {
5682
"match": "\\b(.*)?\\s*",
5683
"captures": {
5684
"1": {
5685
"name": "string.unquoted.preprocessor.message.cs"
5686
}
5687
}
5688
},
5689
"preprocessor-expression": {
5690
"patterns": [
5691
{
5692
"begin": "\\(",
5693
"beginCaptures": {
5694
"0": {
5695
"name": "punctuation.parenthesis.open.cs"
5696
}
5697
},
5698
"end": "\\)",
5699
"endCaptures": {
5700
"0": {
5701
"name": "punctuation.parenthesis.close.cs"
5702
}
5703
},
5704
"patterns": [
5705
{
5706
"include": "#preprocessor-expression"
5707
}
5708
]
5709
},
5710
{
5711
"match": "\\b(?:(true)|(false)|([_[:alpha:]][_[:alnum:]]*))\\b",
5712
"captures": {
5713
"1": {
5714
"name": "constant.language.boolean.true.cs"
5715
},
5716
"2": {
5717
"name": "constant.language.boolean.false.cs"
5718
},
5719
"3": {
5720
"name": "entity.name.variable.preprocessor.symbol.cs"
5721
}
5722
}
5723
},
5724
{
5725
"match": "(==|!=)|(\\!|&&|\\|\\|)",
5726
"captures": {
5727
"1": {
5728
"name": "keyword.operator.comparison.cs"
5729
},
5730
"2": {
5731
"name": "keyword.operator.logical.cs"
5732
}
5733
}
5734
}
5735
]
5736
},
5737
"comment": {
5738
"patterns": [
5739
{
5740
"name": "comment.block.documentation.cs",
5741
"begin": "(^\\s+)?(///)(?!/)",
5742
"while": "^(\\s*)(///)(?!/)",
5743
"captures": {
5744
"1": {
5745
"name": "punctuation.whitespace.comment.leading.cs"
5746
},
5747
"2": {
5748
"name": "punctuation.definition.comment.cs"
5749
}
5750
},
5751
"patterns": [
5752
{
5753
"include": "#xml-doc-comment"
5754
}
5755
]
5756
},
5757
{
5758
"name": "comment.block.documentation.cs",
5759
"begin": "(^\\s+)?(/\\*\\*)(?!/)",
5760
"end": "(^\\s+)?(\\*/)",
5761
"captures": {
5762
"1": {
5763
"name": "punctuation.whitespace.comment.leading.cs"
5764
},
5765
"2": {
5766
"name": "punctuation.definition.comment.cs"
5767
}
5768
},
5769
"patterns": [
5770
{
5771
"begin": "\\G(?=(?~\\*/)$)",
5772
"while": "^(\\s*+)(\\*(?!/))?(?=(?~\\*/)$)",
5773
"whileCaptures": {
5774
"1": {
5775
"name": "punctuation.whitespace.comment.leading.cs"
5776
},
5777
"2": {
5778
"name": "punctuation.definition.comment.cs"
5779
}
5780
},
5781
"patterns": [
5782
{
5783
"include": "#xml-doc-comment"
5784
}
5785
]
5786
},
5787
{
5788
"include": "#xml-doc-comment"
5789
}
5790
]
5791
},
5792
{
5793
"name": "comment.line.double-slash.cs",
5794
"begin": "(^\\s+)?(//).*$",
5795
"while": "^(\\s*)(//).*$",
5796
"captures": {
5797
"1": {
5798
"name": "punctuation.whitespace.comment.leading.cs"
5799
},
5800
"2": {
5801
"name": "punctuation.definition.comment.cs"
5802
}
5803
}
5804
},
5805
{
5806
"name": "comment.block.cs",
5807
"begin": "/\\*",
5808
"end": "\\*/",
5809
"captures": {
5810
"0": {
5811
"name": "punctuation.definition.comment.cs"
5812
}
5813
}
5814
}
5815
]
5816
},
5817
"xml-doc-comment": {
5818
"patterns": [
5819
{
5820
"include": "#xml-comment"
5821
},
5822
{
5823
"include": "#xml-character-entity"
5824
},
5825
{
5826
"include": "#xml-cdata"
5827
},
5828
{
5829
"include": "#xml-tag"
5830
}
5831
]
5832
},
5833
"xml-tag": {
5834
"name": "meta.tag.cs",
5835
"begin": "(?x)\n(</?)\n(\n (?:\n ([-_[:alnum:]]+)\n (:)\n )?\n ([-_[:alnum:]]+)\n)",
5836
"beginCaptures": {
5837
"1": {
5838
"name": "punctuation.definition.tag.cs"
5839
},
5840
"2": {
5841
"name": "entity.name.tag.cs"
5842
},
5843
"3": {
5844
"name": "entity.name.tag.namespace.cs"
5845
},
5846
"4": {
5847
"name": "punctuation.separator.colon.cs"
5848
},
5849
"5": {
5850
"name": "entity.name.tag.localname.cs"
5851
}
5852
},
5853
"end": "(/?>)",
5854
"endCaptures": {
5855
"1": {
5856
"name": "punctuation.definition.tag.cs"
5857
}
5858
},
5859
"patterns": [
5860
{
5861
"include": "#xml-attribute"
5862
}
5863
]
5864
},
5865
"xml-attribute": {
5866
"patterns": [
5867
{
5868
"match": "(?x)\n(?:^|\\s+)\n(\n (?:\n ([-_[:alnum:]]+)\n (:)\n )?\n ([-_[:alnum:]]+)\n)\n(=)",
5869
"captures": {
5870
"1": {
5871
"name": "entity.other.attribute-name.cs"
5872
},
5873
"2": {
5874
"name": "entity.other.attribute-name.namespace.cs"
5875
},
5876
"3": {
5877
"name": "punctuation.separator.colon.cs"
5878
},
5879
"4": {
5880
"name": "entity.other.attribute-name.localname.cs"
5881
},
5882
"5": {
5883
"name": "punctuation.separator.equals.cs"
5884
}
5885
}
5886
},
5887
{
5888
"include": "#xml-string"
5889
}
5890
]
5891
},
5892
"xml-cdata": {
5893
"name": "string.unquoted.cdata.cs",
5894
"begin": "<!\\[CDATA\\[",
5895
"beginCaptures": {
5896
"0": {
5897
"name": "punctuation.definition.string.begin.cs"
5898
}
5899
},
5900
"end": "\\]\\]>",
5901
"endCaptures": {
5902
"0": {
5903
"name": "punctuation.definition.string.end.cs"
5904
}
5905
}
5906
},
5907
"xml-string": {
5908
"patterns": [
5909
{
5910
"name": "string.quoted.single.cs",
5911
"begin": "\\'",
5912
"beginCaptures": {
5913
"0": {
5914
"name": "punctuation.definition.string.begin.cs"
5915
}
5916
},
5917
"end": "\\'",
5918
"endCaptures": {
5919
"0": {
5920
"name": "punctuation.definition.string.end.cs"
5921
}
5922
},
5923
"patterns": [
5924
{
5925
"include": "#xml-character-entity"
5926
}
5927
]
5928
},
5929
{
5930
"name": "string.quoted.double.cs",
5931
"begin": "\\\"",
5932
"beginCaptures": {
5933
"0": {
5934
"name": "punctuation.definition.string.begin.cs"
5935
}
5936
},
5937
"end": "\\\"",
5938
"endCaptures": {
5939
"0": {
5940
"name": "punctuation.definition.string.end.cs"
5941
}
5942
},
5943
"patterns": [
5944
{
5945
"include": "#xml-character-entity"
5946
}
5947
]
5948
}
5949
]
5950
},
5951
"xml-character-entity": {
5952
"patterns": [
5953
{
5954
"name": "constant.character.entity.cs",
5955
"match": "(?x)\n(&)\n(\n (?:[[:alpha:]:_][[:alnum:]:_.-]*)|\n (?:\\#[[:digit:]]+)|\n (?:\\#x[[:xdigit:]]+)\n)\n(;)",
5956
"captures": {
5957
"1": {
5958
"name": "punctuation.definition.constant.cs"
5959
},
5960
"3": {
5961
"name": "punctuation.definition.constant.cs"
5962
}
5963
}
5964
},
5965
{
5966
"name": "invalid.illegal.bad-ampersand.cs",
5967
"match": "&"
5968
}
5969
]
5970
},
5971
"xml-comment": {
5972
"name": "comment.block.cs",
5973
"begin": "<!--",
5974
"beginCaptures": {
5975
"0": {
5976
"name": "punctuation.definition.comment.cs"
5977
}
5978
},
5979
"end": "-->",
5980
"endCaptures": {
5981
"0": {
5982
"name": "punctuation.definition.comment.cs"
5983
}
5984
}
5985
}
5986
}
5987
}
5988