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