@codingame/monaco-vscode-razor-default-extension 1.81.8-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1814 @@
1
+ {
2
+ "information_for_contributors": [
3
+ "This file has been converted from https://github.com/dotnet/razor/blob/master/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension/syntaxes/aspnetcorerazor.tmLanguage.json",
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/razor/commit/69f60231df08319b544d3d32a588575acbb58ff0",
8
+ "name": "ASP.NET Razor",
9
+ "scopeName": "text.html.cshtml",
10
+ "patterns": [
11
+ {
12
+ "include": "#razor-control-structures"
13
+ },
14
+ {
15
+ "include": "text.html.basic"
16
+ }
17
+ ],
18
+ "repository": {
19
+ "razor-control-structures": {
20
+ "patterns": [
21
+ {
22
+ "include": "#razor-comment"
23
+ },
24
+ {
25
+ "include": "#razor-codeblock"
26
+ },
27
+ {
28
+ "include": "#explicit-razor-expression"
29
+ },
30
+ {
31
+ "include": "#escaped-transition"
32
+ },
33
+ {
34
+ "include": "#directives"
35
+ },
36
+ {
37
+ "include": "#transitioned-csharp-control-structures"
38
+ },
39
+ {
40
+ "include": "#implicit-expression"
41
+ }
42
+ ]
43
+ },
44
+ "optionally-transitioned-razor-control-structures": {
45
+ "patterns": [
46
+ {
47
+ "include": "#razor-comment"
48
+ },
49
+ {
50
+ "include": "#razor-codeblock"
51
+ },
52
+ {
53
+ "include": "#explicit-razor-expression"
54
+ },
55
+ {
56
+ "include": "#escaped-transition"
57
+ },
58
+ {
59
+ "include": "#directives"
60
+ },
61
+ {
62
+ "include": "#optionally-transitioned-csharp-control-structures"
63
+ },
64
+ {
65
+ "include": "#implicit-expression"
66
+ }
67
+ ]
68
+ },
69
+ "escaped-transition": {
70
+ "name": "constant.character.escape.razor.transition",
71
+ "match": "@@"
72
+ },
73
+ "transition": {
74
+ "match": "@",
75
+ "name": "keyword.control.cshtml.transition"
76
+ },
77
+ "razor-codeblock": {
78
+ "name": "meta.structure.razor.codeblock",
79
+ "begin": "(@)(\\{)",
80
+ "beginCaptures": {
81
+ "1": {
82
+ "patterns": [
83
+ {
84
+ "include": "#transition"
85
+ }
86
+ ]
87
+ },
88
+ "2": {
89
+ "name": "keyword.control.razor.directive.codeblock.open"
90
+ }
91
+ },
92
+ "contentName": "source.cs",
93
+ "patterns": [
94
+ {
95
+ "include": "#razor-codeblock-body"
96
+ }
97
+ ],
98
+ "end": "(\\})",
99
+ "endCaptures": {
100
+ "1": {
101
+ "name": "keyword.control.razor.directive.codeblock.close"
102
+ }
103
+ }
104
+ },
105
+ "razor-codeblock-body": {
106
+ "patterns": [
107
+ {
108
+ "include": "#text-tag"
109
+ },
110
+ {
111
+ "include": "#wellformed-html"
112
+ },
113
+ {
114
+ "include": "#razor-single-line-markup"
115
+ },
116
+ {
117
+ "include": "#optionally-transitioned-razor-control-structures"
118
+ },
119
+ {
120
+ "include": "source.cs"
121
+ }
122
+ ]
123
+ },
124
+ "razor-single-line-markup": {
125
+ "match": "(\\@\\:)([^$]*)$",
126
+ "captures": {
127
+ "1": {
128
+ "name": "keyword.control.razor.singleLineMarkup"
129
+ },
130
+ "2": {
131
+ "patterns": [
132
+ {
133
+ "include": "#razor-control-structures"
134
+ },
135
+ {
136
+ "include": "text.html.basic"
137
+ }
138
+ ]
139
+ }
140
+ }
141
+ },
142
+ "text-tag": {
143
+ "begin": "(<text\\s*>)",
144
+ "beginCaptures": {
145
+ "1": {
146
+ "name": "keyword.control.cshtml.transition.textTag.open"
147
+ }
148
+ },
149
+ "patterns": [
150
+ {
151
+ "include": "#wellformed-html"
152
+ },
153
+ {
154
+ "include": "$self"
155
+ }
156
+ ],
157
+ "end": "(</text>)",
158
+ "endCaptures": {
159
+ "1": {
160
+ "name": "keyword.control.cshtml.transition.textTag.close"
161
+ }
162
+ }
163
+ },
164
+ "razor-comment": {
165
+ "name": "meta.comment.razor",
166
+ "begin": "(@)(\\*)",
167
+ "beginCaptures": {
168
+ "1": {
169
+ "patterns": [
170
+ {
171
+ "include": "#transition"
172
+ }
173
+ ]
174
+ },
175
+ "2": {
176
+ "name": "keyword.control.razor.comment.star"
177
+ }
178
+ },
179
+ "contentName": "comment.block.razor",
180
+ "end": "(\\*)(@)",
181
+ "endCaptures": {
182
+ "1": {
183
+ "name": "keyword.control.razor.comment.star"
184
+ },
185
+ "2": {
186
+ "patterns": [
187
+ {
188
+ "include": "#transition"
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ },
194
+ "wellformed-html": {
195
+ "patterns": [
196
+ {
197
+ "include": "#void-tag"
198
+ },
199
+ {
200
+ "include": "#non-void-tag"
201
+ }
202
+ ]
203
+ },
204
+ "void-tag": {
205
+ "name": "meta.tag.structure.$3.void.html",
206
+ "begin": "(?i)(<)(!)?(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)(?=\\s|/?>)",
207
+ "beginCaptures": {
208
+ "1": {
209
+ "name": "punctuation.definition.tag.begin.html"
210
+ },
211
+ "2": {
212
+ "name": "constant.character.escape.razor.tagHelperOptOut"
213
+ },
214
+ "3": {
215
+ "name": "entity.name.tag.html"
216
+ }
217
+ },
218
+ "patterns": [
219
+ {
220
+ "include": "text.html.basic#attribute"
221
+ }
222
+ ],
223
+ "end": "/?>",
224
+ "endCaptures": {
225
+ "0": {
226
+ "name": "punctuation.definition.tag.end.html"
227
+ }
228
+ }
229
+ },
230
+ "non-void-tag": {
231
+ "begin": "(?=<(!)?([^/\\s>]+)(\\s|/?>))",
232
+ "end": "(</)(\\2)\\s*(>)|(/>)",
233
+ "endCaptures": {
234
+ "1": {
235
+ "name": "punctuation.definition.tag.begin.html"
236
+ },
237
+ "2": {
238
+ "name": "entity.name.tag.html"
239
+ },
240
+ "3": {
241
+ "name": "punctuation.definition.tag.end.html"
242
+ },
243
+ "4": {
244
+ "name": "punctuation.definition.tag.end.html"
245
+ }
246
+ },
247
+ "patterns": [
248
+ {
249
+ "begin": "(<)(!)?([^/\\s>]+)(?=\\s|/?>)",
250
+ "beginCaptures": {
251
+ "1": {
252
+ "name": "punctuation.definition.tag.begin.html"
253
+ },
254
+ "2": {
255
+ "name": "constant.character.escape.razor.tagHelperOptOut"
256
+ },
257
+ "3": {
258
+ "name": "entity.name.tag.html"
259
+ }
260
+ },
261
+ "end": "(?=/?>)",
262
+ "patterns": [
263
+ {
264
+ "include": "#razor-control-structures"
265
+ },
266
+ {
267
+ "include": "text.html.basic#attribute"
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "begin": ">",
273
+ "beginCaptures": {
274
+ "0": {
275
+ "name": "punctuation.definition.tag.end.html"
276
+ }
277
+ },
278
+ "end": "(?=</)",
279
+ "patterns": [
280
+ {
281
+ "include": "#wellformed-html"
282
+ },
283
+ {
284
+ "include": "$self"
285
+ }
286
+ ]
287
+ }
288
+ ]
289
+ },
290
+ "explicit-razor-expression": {
291
+ "name": "meta.expression.explicit.cshtml",
292
+ "begin": "(@)\\(",
293
+ "beginCaptures": {
294
+ "0": {
295
+ "name": "keyword.control.cshtml"
296
+ },
297
+ "1": {
298
+ "patterns": [
299
+ {
300
+ "include": "#transition"
301
+ }
302
+ ]
303
+ }
304
+ },
305
+ "patterns": [
306
+ {
307
+ "include": "source.cs#expression"
308
+ }
309
+ ],
310
+ "end": "\\)",
311
+ "endCaptures": {
312
+ "0": {
313
+ "name": "keyword.control.cshtml"
314
+ }
315
+ }
316
+ },
317
+ "implicit-expression": {
318
+ "name": "meta.expression.implicit.cshtml",
319
+ "contentName": "source.cs",
320
+ "begin": "(?<![[:alpha:][:alnum:]])(@)",
321
+ "beginCaptures": {
322
+ "1": {
323
+ "patterns": [
324
+ {
325
+ "include": "#transition"
326
+ }
327
+ ]
328
+ }
329
+ },
330
+ "patterns": [
331
+ {
332
+ "include": "#await-prefix"
333
+ },
334
+ {
335
+ "include": "#implicit-expression-body"
336
+ }
337
+ ],
338
+ "end": "(?=[\\s<>\\{\\}\\)\\]'\"])"
339
+ },
340
+ "implicit-expression-body": {
341
+ "patterns": [
342
+ {
343
+ "include": "#implicit-expression-invocation-start"
344
+ },
345
+ {
346
+ "include": "#implicit-expression-accessor-start"
347
+ }
348
+ ],
349
+ "end": "(?=[\\s<>\\{\\}\\)\\]'\"])"
350
+ },
351
+ "implicit-expression-invocation-start": {
352
+ "begin": "([_[:alpha:]][_[:alnum:]]*)(?=\\()",
353
+ "beginCaptures": {
354
+ "1": {
355
+ "name": "entity.name.function.cs"
356
+ }
357
+ },
358
+ "patterns": [
359
+ {
360
+ "include": "#implicit-expression-continuation"
361
+ }
362
+ ],
363
+ "end": "(?=[\\s<>\\{\\}\\)\\]'\"])"
364
+ },
365
+ "implicit-expression-accessor-start": {
366
+ "begin": "([_[:alpha:]][_[:alnum:]]*)",
367
+ "beginCaptures": {
368
+ "1": {
369
+ "name": "variable.other.object.cs"
370
+ }
371
+ },
372
+ "patterns": [
373
+ {
374
+ "include": "#implicit-expression-continuation"
375
+ }
376
+ ],
377
+ "end": "(?=[\\s<>\\{\\}\\)\\]'\"])"
378
+ },
379
+ "implicit-expression-continuation": {
380
+ "patterns": [
381
+ {
382
+ "include": "#balanced-parenthesis-csharp"
383
+ },
384
+ {
385
+ "include": "#balanced-brackets-csharp"
386
+ },
387
+ {
388
+ "include": "#implicit-expression-invocation"
389
+ },
390
+ {
391
+ "include": "#implicit-expression-accessor"
392
+ },
393
+ {
394
+ "include": "#implicit-expression-extension"
395
+ }
396
+ ],
397
+ "end": "(?=[\\s<>\\{\\}\\)\\]'\"])"
398
+ },
399
+ "implicit-expression-accessor": {
400
+ "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*",
401
+ "name": "variable.other.object.property.cs"
402
+ },
403
+ "implicit-expression-invocation": {
404
+ "match": "(?<=\\.)[_[:alpha:]][_[:alnum:]]*(?=\\()",
405
+ "name": "entity.name.function.cs"
406
+ },
407
+ "implicit-expression-operator": {
408
+ "patterns": [
409
+ {
410
+ "include": "#implicit-expression-dot-operator"
411
+ },
412
+ {
413
+ "include": "#implicit-expression-null-conditional-operator"
414
+ },
415
+ {
416
+ "include": "#implicit-expression-null-forgiveness-operator"
417
+ }
418
+ ]
419
+ },
420
+ "implicit-expression-dot-operator": {
421
+ "match": "(\\.)(?=[_[:alpha:]][_[:alnum:]]*)",
422
+ "captures": {
423
+ "1": {
424
+ "name": "punctuation.accessor.cs"
425
+ }
426
+ }
427
+ },
428
+ "implicit-expression-null-conditional-operator": {
429
+ "match": "(\\?)(?=[.\\[])",
430
+ "captures": {
431
+ "1": {
432
+ "name": "keyword.operator.null-conditional.cs"
433
+ }
434
+ }
435
+ },
436
+ "implicit-expression-null-forgiveness-operator": {
437
+ "match": "(\\!)(?=(?:\\.[_[:alpha:]][_[:alnum:]]*)|\\?|[\\[\\(])",
438
+ "captures": {
439
+ "1": {
440
+ "name": "keyword.operator.logical.cs"
441
+ }
442
+ }
443
+ },
444
+ "balanced-parenthesis-csharp": {
445
+ "begin": "(\\()",
446
+ "beginCaptures": {
447
+ "1": {
448
+ "name": "punctuation.parenthesis.open.cs"
449
+ }
450
+ },
451
+ "name": "razor.test.balanced.parenthesis",
452
+ "patterns": [
453
+ {
454
+ "include": "source.cs"
455
+ }
456
+ ],
457
+ "end": "(\\))",
458
+ "endCaptures": {
459
+ "1": {
460
+ "name": "punctuation.parenthesis.close.cs"
461
+ }
462
+ }
463
+ },
464
+ "balanced-brackets-csharp": {
465
+ "begin": "(\\[)",
466
+ "beginCaptures": {
467
+ "1": {
468
+ "name": "punctuation.squarebracket.open.cs"
469
+ }
470
+ },
471
+ "name": "razor.test.balanced.brackets",
472
+ "patterns": [
473
+ {
474
+ "include": "source.cs"
475
+ }
476
+ ],
477
+ "end": "(\\])",
478
+ "endCaptures": {
479
+ "1": {
480
+ "name": "punctuation.squarebracket.close.cs"
481
+ }
482
+ }
483
+ },
484
+ "directives": {
485
+ "patterns": [
486
+ {
487
+ "include": "#code-directive"
488
+ },
489
+ {
490
+ "include": "#functions-directive"
491
+ },
492
+ {
493
+ "include": "#page-directive"
494
+ },
495
+ {
496
+ "include": "#addTagHelper-directive"
497
+ },
498
+ {
499
+ "include": "#removeTagHelper-directive"
500
+ },
501
+ {
502
+ "include": "#tagHelperPrefix-directive"
503
+ },
504
+ {
505
+ "include": "#model-directive"
506
+ },
507
+ {
508
+ "include": "#inherits-directive"
509
+ },
510
+ {
511
+ "include": "#implements-directive"
512
+ },
513
+ {
514
+ "include": "#namespace-directive"
515
+ },
516
+ {
517
+ "include": "#inject-directive"
518
+ },
519
+ {
520
+ "include": "#attribute-directive"
521
+ },
522
+ {
523
+ "include": "#section-directive"
524
+ },
525
+ {
526
+ "include": "#layout-directive"
527
+ },
528
+ {
529
+ "include": "#using-directive"
530
+ }
531
+ ]
532
+ },
533
+ "code-directive": {
534
+ "begin": "(@)(code)((?=\\{)|\\s+)",
535
+ "beginCaptures": {
536
+ "1": {
537
+ "patterns": [
538
+ {
539
+ "include": "#transition"
540
+ }
541
+ ]
542
+ },
543
+ "2": {
544
+ "name": "keyword.control.razor.directive.code"
545
+ }
546
+ },
547
+ "patterns": [
548
+ {
549
+ "include": "#directive-codeblock"
550
+ }
551
+ ],
552
+ "end": "(?<=})|\\s"
553
+ },
554
+ "functions-directive": {
555
+ "begin": "(@)(functions)((?=\\{)|\\s+)",
556
+ "beginCaptures": {
557
+ "1": {
558
+ "patterns": [
559
+ {
560
+ "include": "#transition"
561
+ }
562
+ ]
563
+ },
564
+ "2": {
565
+ "name": "keyword.control.razor.directive.functions"
566
+ }
567
+ },
568
+ "patterns": [
569
+ {
570
+ "include": "#directive-codeblock"
571
+ }
572
+ ],
573
+ "end": "(?<=})|\\s"
574
+ },
575
+ "directive-codeblock": {
576
+ "begin": "(\\{)",
577
+ "beginCaptures": {
578
+ "1": {
579
+ "name": "keyword.control.razor.directive.codeblock.open"
580
+ }
581
+ },
582
+ "name": "meta.structure.razor.directive.codeblock",
583
+ "contentName": "source.cs",
584
+ "patterns": [
585
+ {
586
+ "include": "source.cs#class-or-struct-members"
587
+ }
588
+ ],
589
+ "end": "(\\})",
590
+ "endCaptures": {
591
+ "1": {
592
+ "name": "keyword.control.razor.directive.codeblock.close"
593
+ }
594
+ }
595
+ },
596
+ "page-directive": {
597
+ "name": "meta.directive",
598
+ "match": "(@)(page)\\s+([^$]+)?",
599
+ "captures": {
600
+ "1": {
601
+ "patterns": [
602
+ {
603
+ "include": "#transition"
604
+ }
605
+ ]
606
+ },
607
+ "2": {
608
+ "name": "keyword.control.razor.directive.page"
609
+ },
610
+ "3": {
611
+ "patterns": [
612
+ {
613
+ "include": "source.cs#string-literal"
614
+ }
615
+ ]
616
+ }
617
+ }
618
+ },
619
+ "addTagHelper-directive": {
620
+ "name": "meta.directive",
621
+ "match": "(@)(addTagHelper)\\s+([^$]+)?",
622
+ "captures": {
623
+ "1": {
624
+ "patterns": [
625
+ {
626
+ "include": "#transition"
627
+ }
628
+ ]
629
+ },
630
+ "2": {
631
+ "name": "keyword.control.razor.directive.addTagHelper"
632
+ },
633
+ "3": {
634
+ "patterns": [
635
+ {
636
+ "include": "#tagHelper-directive-argument"
637
+ }
638
+ ]
639
+ }
640
+ }
641
+ },
642
+ "removeTagHelper-directive": {
643
+ "name": "meta.directive",
644
+ "match": "(@)(removeTagHelper)\\s+([^$]+)?",
645
+ "captures": {
646
+ "1": {
647
+ "patterns": [
648
+ {
649
+ "include": "#transition"
650
+ }
651
+ ]
652
+ },
653
+ "2": {
654
+ "name": "keyword.control.razor.directive.removeTagHelper"
655
+ },
656
+ "3": {
657
+ "patterns": [
658
+ {
659
+ "include": "#tagHelper-directive-argument"
660
+ }
661
+ ]
662
+ }
663
+ }
664
+ },
665
+ "tagHelperPrefix-directive": {
666
+ "name": "meta.directive",
667
+ "match": "(@)(tagHelperPrefix)\\s+([^$]+)?",
668
+ "captures": {
669
+ "1": {
670
+ "patterns": [
671
+ {
672
+ "include": "#transition"
673
+ }
674
+ ]
675
+ },
676
+ "2": {
677
+ "name": "keyword.control.razor.directive.tagHelperPrefix"
678
+ },
679
+ "3": {
680
+ "patterns": [
681
+ {
682
+ "include": "#tagHelper-directive-argument"
683
+ }
684
+ ]
685
+ }
686
+ }
687
+ },
688
+ "tagHelper-directive-argument": {
689
+ "patterns": [
690
+ {
691
+ "include": "source.cs#string-literal"
692
+ },
693
+ {
694
+ "include": "#unquoted-string-argument"
695
+ }
696
+ ]
697
+ },
698
+ "unquoted-string-argument": {
699
+ "name": "string.quoted.double.cs",
700
+ "match": "[^$]+"
701
+ },
702
+ "model-directive": {
703
+ "name": "meta.directive",
704
+ "match": "(@)(model)\\s+([^$]+)?",
705
+ "captures": {
706
+ "1": {
707
+ "patterns": [
708
+ {
709
+ "include": "#transition"
710
+ }
711
+ ]
712
+ },
713
+ "2": {
714
+ "name": "keyword.control.razor.directive.model"
715
+ },
716
+ "3": {
717
+ "patterns": [
718
+ {
719
+ "include": "source.cs#type"
720
+ }
721
+ ]
722
+ }
723
+ }
724
+ },
725
+ "inherits-directive": {
726
+ "name": "meta.directive",
727
+ "match": "(@)(inherits)\\s+([^$]+)?",
728
+ "captures": {
729
+ "1": {
730
+ "patterns": [
731
+ {
732
+ "include": "#transition"
733
+ }
734
+ ]
735
+ },
736
+ "2": {
737
+ "name": "keyword.control.razor.directive.inherits"
738
+ },
739
+ "3": {
740
+ "patterns": [
741
+ {
742
+ "include": "source.cs#type"
743
+ }
744
+ ]
745
+ }
746
+ }
747
+ },
748
+ "implements-directive": {
749
+ "name": "meta.directive",
750
+ "match": "(@)(implements)\\s+([^$]+)?",
751
+ "captures": {
752
+ "1": {
753
+ "patterns": [
754
+ {
755
+ "include": "#transition"
756
+ }
757
+ ]
758
+ },
759
+ "2": {
760
+ "name": "keyword.control.razor.directive.implements"
761
+ },
762
+ "3": {
763
+ "patterns": [
764
+ {
765
+ "include": "source.cs#type"
766
+ }
767
+ ]
768
+ }
769
+ }
770
+ },
771
+ "layout-directive": {
772
+ "name": "meta.directive",
773
+ "match": "(@)(layout)\\s+([^$]+)?",
774
+ "captures": {
775
+ "1": {
776
+ "patterns": [
777
+ {
778
+ "include": "#transition"
779
+ }
780
+ ]
781
+ },
782
+ "2": {
783
+ "name": "keyword.control.razor.directive.layout"
784
+ },
785
+ "3": {
786
+ "patterns": [
787
+ {
788
+ "include": "source.cs#type"
789
+ }
790
+ ]
791
+ }
792
+ }
793
+ },
794
+ "namespace-directive": {
795
+ "name": "meta.directive",
796
+ "match": "(@)(namespace)\\s+([^\\s]+)?",
797
+ "captures": {
798
+ "1": {
799
+ "patterns": [
800
+ {
801
+ "include": "#transition"
802
+ }
803
+ ]
804
+ },
805
+ "2": {
806
+ "name": "keyword.control.razor.directive.namespace"
807
+ },
808
+ "3": {
809
+ "patterns": [
810
+ {
811
+ "include": "#namespace-directive-argument"
812
+ }
813
+ ]
814
+ }
815
+ }
816
+ },
817
+ "namespace-directive-argument": {
818
+ "match": "([_[:alpha:]][_[:alnum:]]*)(\\.)?",
819
+ "captures": {
820
+ "1": {
821
+ "name": "entity.name.type.namespace.cs"
822
+ },
823
+ "2": {
824
+ "name": "punctuation.accessor.cs"
825
+ }
826
+ }
827
+ },
828
+ "inject-directive": {
829
+ "name": "meta.directive",
830
+ "match": "(@)(inject)\\s*([\\S\\s]+?)?\\s*([_[:alpha:]][_[:alnum:]]*)?\\s*(?=$)",
831
+ "captures": {
832
+ "1": {
833
+ "patterns": [
834
+ {
835
+ "include": "#transition"
836
+ }
837
+ ]
838
+ },
839
+ "2": {
840
+ "name": "keyword.control.razor.directive.inject"
841
+ },
842
+ "3": {
843
+ "patterns": [
844
+ {
845
+ "include": "source.cs#type"
846
+ }
847
+ ]
848
+ },
849
+ "4": {
850
+ "name": "entity.name.variable.property.cs"
851
+ }
852
+ }
853
+ },
854
+ "attribute-directive": {
855
+ "name": "meta.directive",
856
+ "begin": "(@)(attribute)\\b\\s+",
857
+ "beginCaptures": {
858
+ "1": {
859
+ "patterns": [
860
+ {
861
+ "include": "#transition"
862
+ }
863
+ ]
864
+ },
865
+ "2": {
866
+ "name": "keyword.control.razor.directive.attribute"
867
+ }
868
+ },
869
+ "patterns": [
870
+ {
871
+ "include": "source.cs#attribute-section"
872
+ }
873
+ ],
874
+ "end": "(?<=\\])|$"
875
+ },
876
+ "section-directive": {
877
+ "name": "meta.directive.block",
878
+ "begin": "(@)(section)\\b\\s+([_[:alpha:]][_[:alnum:]]*)?",
879
+ "beginCaptures": {
880
+ "1": {
881
+ "patterns": [
882
+ {
883
+ "include": "#transition"
884
+ }
885
+ ]
886
+ },
887
+ "2": {
888
+ "name": "keyword.control.razor.directive.section"
889
+ },
890
+ "3": {
891
+ "name": "variable.other.razor.directive.sectionName"
892
+ }
893
+ },
894
+ "patterns": [
895
+ {
896
+ "include": "#directive-markupblock"
897
+ }
898
+ ],
899
+ "end": "(?<=})"
900
+ },
901
+ "directive-markupblock": {
902
+ "name": "meta.structure.razor.directive.markblock",
903
+ "begin": "(\\{)",
904
+ "beginCaptures": {
905
+ "1": {
906
+ "name": "keyword.control.razor.directive.codeblock.open"
907
+ }
908
+ },
909
+ "patterns": [
910
+ {
911
+ "include": "$self"
912
+ }
913
+ ],
914
+ "end": "(\\})",
915
+ "endCaptures": {
916
+ "1": {
917
+ "name": "keyword.control.razor.directive.codeblock.close"
918
+ }
919
+ }
920
+ },
921
+ "using-directive": {
922
+ "name": "meta.directive",
923
+ "match": "(@)(using)\\b\\s+(?!\\(|\\s)(.+?)?(;)?$",
924
+ "captures": {
925
+ "1": {
926
+ "patterns": [
927
+ {
928
+ "include": "#transition"
929
+ }
930
+ ]
931
+ },
932
+ "2": {
933
+ "name": "keyword.other.using.cs"
934
+ },
935
+ "3": {
936
+ "patterns": [
937
+ {
938
+ "include": "#using-static-directive"
939
+ },
940
+ {
941
+ "include": "#using-alias-directive"
942
+ },
943
+ {
944
+ "include": "#using-standard-directive"
945
+ }
946
+ ]
947
+ },
948
+ "4": {
949
+ "name": "keyword.control.razor.optionalSemicolon"
950
+ }
951
+ }
952
+ },
953
+ "using-static-directive": {
954
+ "match": "(static)\\b\\s+(.+)",
955
+ "captures": {
956
+ "1": {
957
+ "name": "keyword.other.static.cs"
958
+ },
959
+ "2": {
960
+ "patterns": [
961
+ {
962
+ "include": "source.cs#type"
963
+ }
964
+ ]
965
+ }
966
+ }
967
+ },
968
+ "using-alias-directive": {
969
+ "match": "([_[:alpha:]][_[:alnum:]]*)\\b\\s*(=)\\s*(.+)\\s*",
970
+ "captures": {
971
+ "1": {
972
+ "name": "entity.name.type.alias.cs"
973
+ },
974
+ "2": {
975
+ "name": "keyword.operator.assignment.cs"
976
+ },
977
+ "3": {
978
+ "patterns": [
979
+ {
980
+ "include": "source.cs#type"
981
+ }
982
+ ]
983
+ }
984
+ }
985
+ },
986
+ "using-standard-directive": {
987
+ "match": "([_[:alpha:]][_[:alnum:]]*)\\s*",
988
+ "captures": {
989
+ "1": {
990
+ "name": "entity.name.type.namespace.cs"
991
+ }
992
+ }
993
+ },
994
+ "optionally-transitioned-csharp-control-structures": {
995
+ "patterns": [
996
+ {
997
+ "include": "#using-statement-with-optional-transition"
998
+ },
999
+ {
1000
+ "include": "#if-statement-with-optional-transition"
1001
+ },
1002
+ {
1003
+ "include": "#else-part"
1004
+ },
1005
+ {
1006
+ "include": "#foreach-statement-with-optional-transition"
1007
+ },
1008
+ {
1009
+ "include": "#for-statement-with-optional-transition"
1010
+ },
1011
+ {
1012
+ "include": "#while-statement"
1013
+ },
1014
+ {
1015
+ "include": "#switch-statement-with-optional-transition"
1016
+ },
1017
+ {
1018
+ "include": "#lock-statement-with-optional-transition"
1019
+ },
1020
+ {
1021
+ "include": "#do-statement-with-optional-transition"
1022
+ },
1023
+ {
1024
+ "include": "#try-statement-with-optional-transition"
1025
+ }
1026
+ ]
1027
+ },
1028
+ "transitioned-csharp-control-structures": {
1029
+ "patterns": [
1030
+ {
1031
+ "include": "#using-statement"
1032
+ },
1033
+ {
1034
+ "include": "#if-statement"
1035
+ },
1036
+ {
1037
+ "include": "#else-part"
1038
+ },
1039
+ {
1040
+ "include": "#foreach-statement"
1041
+ },
1042
+ {
1043
+ "include": "#for-statement"
1044
+ },
1045
+ {
1046
+ "include": "#while-statement"
1047
+ },
1048
+ {
1049
+ "include": "#switch-statement"
1050
+ },
1051
+ {
1052
+ "include": "#lock-statement"
1053
+ },
1054
+ {
1055
+ "include": "#do-statement"
1056
+ },
1057
+ {
1058
+ "include": "#try-statement"
1059
+ }
1060
+ ]
1061
+ },
1062
+ "using-statement": {
1063
+ "name": "meta.statement.using.razor",
1064
+ "begin": "(?:(@))(using)\\b\\s*(?=\\()",
1065
+ "beginCaptures": {
1066
+ "1": {
1067
+ "patterns": [
1068
+ {
1069
+ "include": "#transition"
1070
+ }
1071
+ ]
1072
+ },
1073
+ "2": {
1074
+ "name": "keyword.other.using.cs"
1075
+ }
1076
+ },
1077
+ "patterns": [
1078
+ {
1079
+ "include": "#csharp-condition"
1080
+ },
1081
+ {
1082
+ "include": "#csharp-code-block"
1083
+ },
1084
+ {
1085
+ "include": "#razor-codeblock-body"
1086
+ }
1087
+ ],
1088
+ "end": "(?<=})"
1089
+ },
1090
+ "using-statement-with-optional-transition": {
1091
+ "name": "meta.statement.using.razor",
1092
+ "begin": "(?:^\\s*|(@))(using)\\b\\s*(?=\\()",
1093
+ "beginCaptures": {
1094
+ "1": {
1095
+ "patterns": [
1096
+ {
1097
+ "include": "#transition"
1098
+ }
1099
+ ]
1100
+ },
1101
+ "2": {
1102
+ "name": "keyword.other.using.cs"
1103
+ }
1104
+ },
1105
+ "patterns": [
1106
+ {
1107
+ "include": "#csharp-condition"
1108
+ },
1109
+ {
1110
+ "include": "#csharp-code-block"
1111
+ },
1112
+ {
1113
+ "include": "#razor-codeblock-body"
1114
+ }
1115
+ ],
1116
+ "end": "(?<=})"
1117
+ },
1118
+ "if-statement": {
1119
+ "name": "meta.statement.if.razor",
1120
+ "begin": "(?:(@))(if)\\b\\s*(?=\\()",
1121
+ "beginCaptures": {
1122
+ "1": {
1123
+ "patterns": [
1124
+ {
1125
+ "include": "#transition"
1126
+ }
1127
+ ]
1128
+ },
1129
+ "2": {
1130
+ "name": "keyword.control.conditional.if.cs"
1131
+ }
1132
+ },
1133
+ "patterns": [
1134
+ {
1135
+ "include": "#csharp-condition"
1136
+ },
1137
+ {
1138
+ "include": "#csharp-code-block"
1139
+ },
1140
+ {
1141
+ "include": "#razor-codeblock-body"
1142
+ }
1143
+ ],
1144
+ "end": "(?<=})"
1145
+ },
1146
+ "if-statement-with-optional-transition": {
1147
+ "name": "meta.statement.if.razor",
1148
+ "begin": "(?:^\\s*|(@))(if)\\b\\s*(?=\\()",
1149
+ "beginCaptures": {
1150
+ "1": {
1151
+ "patterns": [
1152
+ {
1153
+ "include": "#transition"
1154
+ }
1155
+ ]
1156
+ },
1157
+ "2": {
1158
+ "name": "keyword.control.conditional.if.cs"
1159
+ }
1160
+ },
1161
+ "patterns": [
1162
+ {
1163
+ "include": "#csharp-condition"
1164
+ },
1165
+ {
1166
+ "include": "#csharp-code-block"
1167
+ },
1168
+ {
1169
+ "include": "#razor-codeblock-body"
1170
+ }
1171
+ ],
1172
+ "end": "(?<=})"
1173
+ },
1174
+ "else-part": {
1175
+ "name": "meta.statement.else.razor",
1176
+ "begin": "(?:^|(?<=}))\\s*(else)\\b\\s*?(?: (if))?\\s*?(?=[\\n\\(\\{])",
1177
+ "beginCaptures": {
1178
+ "1": {
1179
+ "name": "keyword.control.conditional.else.cs"
1180
+ },
1181
+ "2": {
1182
+ "name": "keyword.control.conditional.if.cs"
1183
+ }
1184
+ },
1185
+ "patterns": [
1186
+ {
1187
+ "include": "#csharp-condition"
1188
+ },
1189
+ {
1190
+ "include": "#csharp-code-block"
1191
+ },
1192
+ {
1193
+ "include": "#razor-codeblock-body"
1194
+ }
1195
+ ],
1196
+ "end": "(?<=})"
1197
+ },
1198
+ "for-statement": {
1199
+ "name": "meta.statement.for.razor",
1200
+ "begin": "(?:(@))(for)\\b\\s*(?=\\()",
1201
+ "beginCaptures": {
1202
+ "1": {
1203
+ "patterns": [
1204
+ {
1205
+ "include": "#transition"
1206
+ }
1207
+ ]
1208
+ },
1209
+ "2": {
1210
+ "name": "keyword.control.loop.for.cs"
1211
+ }
1212
+ },
1213
+ "patterns": [
1214
+ {
1215
+ "include": "#csharp-condition"
1216
+ },
1217
+ {
1218
+ "include": "#csharp-code-block"
1219
+ },
1220
+ {
1221
+ "include": "#razor-codeblock-body"
1222
+ }
1223
+ ],
1224
+ "end": "(?<=})"
1225
+ },
1226
+ "for-statement-with-optional-transition": {
1227
+ "name": "meta.statement.for.razor",
1228
+ "begin": "(?:^\\s*|(@))(for)\\b\\s*(?=\\()",
1229
+ "beginCaptures": {
1230
+ "1": {
1231
+ "patterns": [
1232
+ {
1233
+ "include": "#transition"
1234
+ }
1235
+ ]
1236
+ },
1237
+ "2": {
1238
+ "name": "keyword.control.loop.for.cs"
1239
+ }
1240
+ },
1241
+ "patterns": [
1242
+ {
1243
+ "include": "#csharp-condition"
1244
+ },
1245
+ {
1246
+ "include": "#csharp-code-block"
1247
+ },
1248
+ {
1249
+ "include": "#razor-codeblock-body"
1250
+ }
1251
+ ],
1252
+ "end": "(?<=})"
1253
+ },
1254
+ "foreach-statement": {
1255
+ "name": "meta.statement.foreach.razor",
1256
+ "begin": "(?:(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()",
1257
+ "beginCaptures": {
1258
+ "1": {
1259
+ "patterns": [
1260
+ {
1261
+ "include": "#transition"
1262
+ }
1263
+ ]
1264
+ },
1265
+ "2": {
1266
+ "patterns": [
1267
+ {
1268
+ "include": "#await-prefix"
1269
+ }
1270
+ ]
1271
+ },
1272
+ "3": {
1273
+ "name": "keyword.control.loop.foreach.cs"
1274
+ }
1275
+ },
1276
+ "patterns": [
1277
+ {
1278
+ "include": "#foreach-condition"
1279
+ },
1280
+ {
1281
+ "include": "#csharp-code-block"
1282
+ },
1283
+ {
1284
+ "include": "#razor-codeblock-body"
1285
+ }
1286
+ ],
1287
+ "end": "(?<=})"
1288
+ },
1289
+ "foreach-statement-with-optional-transition": {
1290
+ "name": "meta.statement.foreach.razor",
1291
+ "begin": "(?:^\\s*|(@)(await\\s+)?)(foreach)\\b\\s*(?=\\()",
1292
+ "beginCaptures": {
1293
+ "1": {
1294
+ "patterns": [
1295
+ {
1296
+ "include": "#transition"
1297
+ }
1298
+ ]
1299
+ },
1300
+ "2": {
1301
+ "patterns": [
1302
+ {
1303
+ "include": "#await-prefix"
1304
+ }
1305
+ ]
1306
+ },
1307
+ "3": {
1308
+ "name": "keyword.control.loop.foreach.cs"
1309
+ }
1310
+ },
1311
+ "patterns": [
1312
+ {
1313
+ "include": "#foreach-condition"
1314
+ },
1315
+ {
1316
+ "include": "#csharp-code-block"
1317
+ },
1318
+ {
1319
+ "include": "#razor-codeblock-body"
1320
+ }
1321
+ ],
1322
+ "end": "(?<=})"
1323
+ },
1324
+ "foreach-condition": {
1325
+ "begin": "\\(",
1326
+ "beginCaptures": {
1327
+ "0": {
1328
+ "name": "punctuation.parenthesis.open.cs"
1329
+ }
1330
+ },
1331
+ "end": "\\)",
1332
+ "endCaptures": {
1333
+ "0": {
1334
+ "name": "punctuation.parenthesis.close.cs"
1335
+ }
1336
+ },
1337
+ "patterns": [
1338
+ {
1339
+ "match": "(?x)\n(?:\n (\\bvar\\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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g<identifier>)\\s+\n\\b(in)\\b",
1340
+ "captures": {
1341
+ "1": {
1342
+ "name": "keyword.other.var.cs"
1343
+ },
1344
+ "2": {
1345
+ "patterns": [
1346
+ {
1347
+ "include": "source.cs#type"
1348
+ }
1349
+ ]
1350
+ },
1351
+ "7": {
1352
+ "name": "entity.name.variable.local.cs"
1353
+ },
1354
+ "8": {
1355
+ "name": "keyword.control.loop.in.cs"
1356
+ }
1357
+ }
1358
+ },
1359
+ {
1360
+ "match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s+\n\\b(in)\\b",
1361
+ "captures": {
1362
+ "1": {
1363
+ "name": "keyword.other.var.cs"
1364
+ },
1365
+ "2": {
1366
+ "patterns": [
1367
+ {
1368
+ "include": "source.cs#tuple-declaration-deconstruction-element-list"
1369
+ }
1370
+ ]
1371
+ },
1372
+ "3": {
1373
+ "name": "keyword.control.loop.in.cs"
1374
+ }
1375
+ }
1376
+ },
1377
+ {
1378
+ "include": "source.cs#expression"
1379
+ }
1380
+ ]
1381
+ },
1382
+ "do-statement": {
1383
+ "name": "meta.statement.do.razor",
1384
+ "begin": "(?:(@))(do)\\b\\s",
1385
+ "beginCaptures": {
1386
+ "1": {
1387
+ "patterns": [
1388
+ {
1389
+ "include": "#transition"
1390
+ }
1391
+ ]
1392
+ },
1393
+ "2": {
1394
+ "name": "keyword.control.loop.do.cs"
1395
+ }
1396
+ },
1397
+ "patterns": [
1398
+ {
1399
+ "include": "#csharp-condition"
1400
+ },
1401
+ {
1402
+ "include": "#csharp-code-block"
1403
+ },
1404
+ {
1405
+ "include": "#razor-codeblock-body"
1406
+ }
1407
+ ],
1408
+ "end": "(?<=})"
1409
+ },
1410
+ "do-statement-with-optional-transition": {
1411
+ "name": "meta.statement.do.razor",
1412
+ "begin": "(?:^\\s*|(@))(do)\\b\\s",
1413
+ "beginCaptures": {
1414
+ "1": {
1415
+ "patterns": [
1416
+ {
1417
+ "include": "#transition"
1418
+ }
1419
+ ]
1420
+ },
1421
+ "2": {
1422
+ "name": "keyword.control.loop.do.cs"
1423
+ }
1424
+ },
1425
+ "patterns": [
1426
+ {
1427
+ "include": "#csharp-condition"
1428
+ },
1429
+ {
1430
+ "include": "#csharp-code-block"
1431
+ },
1432
+ {
1433
+ "include": "#razor-codeblock-body"
1434
+ }
1435
+ ],
1436
+ "end": "(?<=})"
1437
+ },
1438
+ "while-statement": {
1439
+ "name": "meta.statement.while.razor",
1440
+ "begin": "(?:(@)|^\\s*|(?<=})\\s*)(while)\\b\\s*(?=\\()",
1441
+ "beginCaptures": {
1442
+ "1": {
1443
+ "patterns": [
1444
+ {
1445
+ "include": "#transition"
1446
+ }
1447
+ ]
1448
+ },
1449
+ "2": {
1450
+ "name": "keyword.control.loop.while.cs"
1451
+ }
1452
+ },
1453
+ "patterns": [
1454
+ {
1455
+ "include": "#csharp-condition"
1456
+ },
1457
+ {
1458
+ "include": "#csharp-code-block"
1459
+ },
1460
+ {
1461
+ "include": "#razor-codeblock-body"
1462
+ }
1463
+ ],
1464
+ "end": "(?<=})|(;)",
1465
+ "endCaptures": {
1466
+ "1": {
1467
+ "name": "punctuation.terminator.statement.cs"
1468
+ }
1469
+ }
1470
+ },
1471
+ "switch-statement": {
1472
+ "name": "meta.statement.switch.razor",
1473
+ "begin": "(?:(@))(switch)\\b\\s*(?=\\()",
1474
+ "beginCaptures": {
1475
+ "1": {
1476
+ "patterns": [
1477
+ {
1478
+ "include": "#transition"
1479
+ }
1480
+ ]
1481
+ },
1482
+ "2": {
1483
+ "name": "keyword.control.switch.cs"
1484
+ }
1485
+ },
1486
+ "patterns": [
1487
+ {
1488
+ "include": "#csharp-condition"
1489
+ },
1490
+ {
1491
+ "include": "#switch-code-block"
1492
+ },
1493
+ {
1494
+ "include": "#razor-codeblock-body"
1495
+ }
1496
+ ],
1497
+ "end": "(?<=})"
1498
+ },
1499
+ "switch-statement-with-optional-transition": {
1500
+ "name": "meta.statement.switch.razor",
1501
+ "begin": "(?:^\\s*|(@))(switch)\\b\\s*(?=\\()",
1502
+ "beginCaptures": {
1503
+ "1": {
1504
+ "patterns": [
1505
+ {
1506
+ "include": "#transition"
1507
+ }
1508
+ ]
1509
+ },
1510
+ "2": {
1511
+ "name": "keyword.control.switch.cs"
1512
+ }
1513
+ },
1514
+ "patterns": [
1515
+ {
1516
+ "include": "#csharp-condition"
1517
+ },
1518
+ {
1519
+ "include": "#switch-code-block"
1520
+ },
1521
+ {
1522
+ "include": "#razor-codeblock-body"
1523
+ }
1524
+ ],
1525
+ "end": "(?<=})"
1526
+ },
1527
+ "switch-code-block": {
1528
+ "name": "meta.structure.razor.csharp.codeblock.switch",
1529
+ "begin": "(\\{)",
1530
+ "beginCaptures": {
1531
+ "1": {
1532
+ "name": "punctuation.curlybrace.open.cs"
1533
+ }
1534
+ },
1535
+ "patterns": [
1536
+ {
1537
+ "include": "source.cs#switch-label"
1538
+ },
1539
+ {
1540
+ "include": "#razor-codeblock-body"
1541
+ }
1542
+ ],
1543
+ "end": "(\\})",
1544
+ "endCaptures": {
1545
+ "1": {
1546
+ "name": "punctuation.curlybrace.close.cs"
1547
+ }
1548
+ }
1549
+ },
1550
+ "lock-statement": {
1551
+ "name": "meta.statement.lock.razor",
1552
+ "begin": "(?:(@))(lock)\\b\\s*(?=\\()",
1553
+ "beginCaptures": {
1554
+ "1": {
1555
+ "patterns": [
1556
+ {
1557
+ "include": "#transition"
1558
+ }
1559
+ ]
1560
+ },
1561
+ "2": {
1562
+ "name": "keyword.other.lock.cs"
1563
+ }
1564
+ },
1565
+ "patterns": [
1566
+ {
1567
+ "include": "#csharp-condition"
1568
+ },
1569
+ {
1570
+ "include": "#csharp-code-block"
1571
+ },
1572
+ {
1573
+ "include": "#razor-codeblock-body"
1574
+ }
1575
+ ],
1576
+ "end": "(?<=})"
1577
+ },
1578
+ "lock-statement-with-optional-transition": {
1579
+ "name": "meta.statement.lock.razor",
1580
+ "begin": "(?:^\\s*|(@))(lock)\\b\\s*(?=\\()",
1581
+ "beginCaptures": {
1582
+ "1": {
1583
+ "patterns": [
1584
+ {
1585
+ "include": "#transition"
1586
+ }
1587
+ ]
1588
+ },
1589
+ "2": {
1590
+ "name": "keyword.other.lock.cs"
1591
+ }
1592
+ },
1593
+ "patterns": [
1594
+ {
1595
+ "include": "#csharp-condition"
1596
+ },
1597
+ {
1598
+ "include": "#csharp-code-block"
1599
+ },
1600
+ {
1601
+ "include": "#razor-codeblock-body"
1602
+ }
1603
+ ],
1604
+ "end": "(?<=})"
1605
+ },
1606
+ "try-statement": {
1607
+ "patterns": [
1608
+ {
1609
+ "include": "#try-block"
1610
+ },
1611
+ {
1612
+ "include": "#catch-clause"
1613
+ },
1614
+ {
1615
+ "include": "#finally-clause"
1616
+ }
1617
+ ]
1618
+ },
1619
+ "try-statement-with-optional-transition": {
1620
+ "patterns": [
1621
+ {
1622
+ "include": "#try-block-with-optional-transition"
1623
+ },
1624
+ {
1625
+ "include": "#catch-clause"
1626
+ },
1627
+ {
1628
+ "include": "#finally-clause"
1629
+ }
1630
+ ]
1631
+ },
1632
+ "try-block": {
1633
+ "name": "meta.statement.try.razor",
1634
+ "begin": "(?:(@))(try)\\b\\s*",
1635
+ "beginCaptures": {
1636
+ "1": {
1637
+ "patterns": [
1638
+ {
1639
+ "include": "#transition"
1640
+ }
1641
+ ]
1642
+ },
1643
+ "2": {
1644
+ "name": "keyword.control.try.cs"
1645
+ }
1646
+ },
1647
+ "patterns": [
1648
+ {
1649
+ "include": "#csharp-condition"
1650
+ },
1651
+ {
1652
+ "include": "#csharp-code-block"
1653
+ },
1654
+ {
1655
+ "include": "#razor-codeblock-body"
1656
+ }
1657
+ ],
1658
+ "end": "(?<=})"
1659
+ },
1660
+ "try-block-with-optional-transition": {
1661
+ "name": "meta.statement.try.razor",
1662
+ "begin": "(?:^\\s*|(@))(try)\\b\\s*",
1663
+ "beginCaptures": {
1664
+ "1": {
1665
+ "patterns": [
1666
+ {
1667
+ "include": "#transition"
1668
+ }
1669
+ ]
1670
+ },
1671
+ "2": {
1672
+ "name": "keyword.control.try.cs"
1673
+ }
1674
+ },
1675
+ "patterns": [
1676
+ {
1677
+ "include": "#csharp-condition"
1678
+ },
1679
+ {
1680
+ "include": "#csharp-code-block"
1681
+ },
1682
+ {
1683
+ "include": "#razor-codeblock-body"
1684
+ }
1685
+ ],
1686
+ "end": "(?<=})"
1687
+ },
1688
+ "catch-clause": {
1689
+ "name": "meta.statement.catch.razor",
1690
+ "begin": "(?:^|(?<=}))\\s*(catch)\\b\\s*?(?=[\\n\\(\\{])",
1691
+ "beginCaptures": {
1692
+ "1": {
1693
+ "name": "keyword.control.try.catch.cs"
1694
+ }
1695
+ },
1696
+ "patterns": [
1697
+ {
1698
+ "include": "#catch-condition"
1699
+ },
1700
+ {
1701
+ "include": "source.cs#when-clause"
1702
+ },
1703
+ {
1704
+ "include": "#csharp-code-block"
1705
+ },
1706
+ {
1707
+ "include": "#razor-codeblock-body"
1708
+ }
1709
+ ],
1710
+ "end": "(?<=})"
1711
+ },
1712
+ "catch-condition": {
1713
+ "begin": "\\(",
1714
+ "beginCaptures": {
1715
+ "0": {
1716
+ "name": "punctuation.parenthesis.open.cs"
1717
+ }
1718
+ },
1719
+ "end": "\\)",
1720
+ "endCaptures": {
1721
+ "0": {
1722
+ "name": "punctuation.parenthesis.close.cs"
1723
+ }
1724
+ },
1725
+ "patterns": [
1726
+ {
1727
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?:(\\g<identifier>)\\b)?",
1728
+ "captures": {
1729
+ "1": {
1730
+ "patterns": [
1731
+ {
1732
+ "include": "source.cs#type"
1733
+ }
1734
+ ]
1735
+ },
1736
+ "6": {
1737
+ "name": "entity.name.variable.local.cs"
1738
+ }
1739
+ }
1740
+ }
1741
+ ]
1742
+ },
1743
+ "finally-clause": {
1744
+ "name": "meta.statement.finally.razor",
1745
+ "begin": "(?:^|(?<=}))\\s*(finally)\\b\\s*?(?=[\\n\\{])",
1746
+ "beginCaptures": {
1747
+ "1": {
1748
+ "name": "keyword.control.try.finally.cs"
1749
+ }
1750
+ },
1751
+ "patterns": [
1752
+ {
1753
+ "include": "#csharp-code-block"
1754
+ },
1755
+ {
1756
+ "include": "#razor-codeblock-body"
1757
+ }
1758
+ ],
1759
+ "end": "(?<=})"
1760
+ },
1761
+ "await-prefix": {
1762
+ "name": "keyword.other.await.cs",
1763
+ "match": "(await)\\s+"
1764
+ },
1765
+ "csharp-code-block": {
1766
+ "name": "meta.structure.razor.csharp.codeblock",
1767
+ "begin": "(\\{)",
1768
+ "beginCaptures": {
1769
+ "1": {
1770
+ "name": "punctuation.curlybrace.open.cs"
1771
+ }
1772
+ },
1773
+ "patterns": [
1774
+ {
1775
+ "include": "#razor-codeblock-body"
1776
+ }
1777
+ ],
1778
+ "end": "(\\})",
1779
+ "endCaptures": {
1780
+ "1": {
1781
+ "name": "punctuation.curlybrace.close.cs"
1782
+ }
1783
+ }
1784
+ },
1785
+ "csharp-condition": {
1786
+ "begin": "(\\()",
1787
+ "beginCaptures": {
1788
+ "1": {
1789
+ "name": "punctuation.parenthesis.open.cs"
1790
+ }
1791
+ },
1792
+ "patterns": [
1793
+ {
1794
+ "include": "source.cs#local-variable-declaration"
1795
+ },
1796
+ {
1797
+ "include": "source.cs#expression"
1798
+ },
1799
+ {
1800
+ "include": "source.cs#punctuation-comma"
1801
+ },
1802
+ {
1803
+ "include": "source.cs#punctuation-semicolon"
1804
+ }
1805
+ ],
1806
+ "end": "(\\))",
1807
+ "endCaptures": {
1808
+ "1": {
1809
+ "name": "punctuation.parenthesis.close.cs"
1810
+ }
1811
+ }
1812
+ }
1813
+ }
1814
+ }