tm-grammars 0.0.0

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