@codingame/monaco-vscode-csharp-default-extension 1.82.6 → 1.83.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.
Files changed (2) hide show
  1. package/csharp.tmLanguage.json +1146 -475
  2. package/package.json +2 -2
@@ -4,7 +4,7 @@
4
4
  "If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
5
  "Once accepted there, we are happy to receive an update request."
6
6
  ],
7
- "version": "https://github.com/dotnet/csharp-tmLanguage/commit/772323937fedd65c6dc1c8ce6ea41d97415ed7d1",
7
+ "version": "https://github.com/dotnet/csharp-tmLanguage/commit/525e628edad54c0f7aa15b015310df240803ea66",
8
8
  "name": "C#",
9
9
  "scopeName": "source.cs",
10
10
  "patterns": [
@@ -210,9 +210,6 @@
210
210
  {
211
211
  "include": "#else-part"
212
212
  },
213
- {
214
- "include": "#switch-statement"
215
- },
216
213
  {
217
214
  "include": "#goto-statement"
218
215
  },
@@ -238,10 +235,10 @@
238
235
  "include": "#checked-unchecked-statement"
239
236
  },
240
237
  {
241
- "include": "#lock-statement"
238
+ "include": "#context-control-statement"
242
239
  },
243
240
  {
244
- "include": "#using-statement"
241
+ "include": "#context-control-paren-statement"
245
242
  },
246
243
  {
247
244
  "include": "#labeled-statement"
@@ -278,13 +275,10 @@
278
275
  "include": "#comment"
279
276
  },
280
277
  {
281
- "include": "#checked-unchecked-expression"
278
+ "include": "#expression-operator-expression"
282
279
  },
283
280
  {
284
- "include": "#typeof-or-default-expression"
285
- },
286
- {
287
- "include": "#nameof-expression"
281
+ "include": "#type-operator-expression"
288
282
  },
289
283
  {
290
284
  "include": "#default-literal-expression"
@@ -305,14 +299,20 @@
305
299
  "include": "#type-builtin"
306
300
  },
307
301
  {
308
- "include": "#this-or-base-expression"
302
+ "include": "#language-variable"
303
+ },
304
+ {
305
+ "include": "#switch-statement-or-expression"
309
306
  },
310
307
  {
311
- "include": "#switch-expression"
308
+ "include": "#with-expression"
312
309
  },
313
310
  {
314
311
  "include": "#conditional-operator"
315
312
  },
313
+ {
314
+ "include": "#assignment-expression"
315
+ },
316
316
  {
317
317
  "include": "#expression-operators"
318
318
  },
@@ -370,36 +370,39 @@
370
370
  ]
371
371
  },
372
372
  "extern-alias-directive": {
373
- "begin": "\\s*(extern)\\b\\s*(alias)\\b\\s*(@?[_[:alpha:]][_[:alnum:]]*)",
373
+ "begin": "\\b(extern)\\s+(alias)\\b",
374
374
  "beginCaptures": {
375
375
  "1": {
376
- "name": "keyword.other.extern.cs"
376
+ "name": "keyword.other.directive.extern.cs"
377
377
  },
378
378
  "2": {
379
- "name": "keyword.other.alias.cs"
380
- },
381
- "3": {
382
- "name": "variable.other.alias.cs"
379
+ "name": "keyword.other.directive.alias.cs"
383
380
  }
384
381
  },
385
- "end": "(?=;)"
382
+ "end": "(?=;)",
383
+ "patterns": [
384
+ {
385
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
386
+ "name": "variable.other.alias.cs"
387
+ }
388
+ ]
386
389
  },
387
390
  "using-directive": {
388
391
  "patterns": [
389
392
  {
390
- "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(static)\\b\\s+(\\b(unsafe)\\b\\s+)?",
393
+ "begin": "\\b(?:(global)\\s+)?(using)\\s+(static)\\b\\s*(?:(unsafe)\\b\\s*)?",
391
394
  "beginCaptures": {
395
+ "1": {
396
+ "name": "keyword.other.directive.global.cs"
397
+ },
392
398
  "2": {
393
- "name": "keyword.other.global.cs"
399
+ "name": "keyword.other.directive.using.cs"
394
400
  },
395
401
  "3": {
396
- "name": "keyword.other.using.cs"
402
+ "name": "keyword.other.directive.static.cs"
397
403
  },
398
404
  "4": {
399
- "name": "keyword.other.static.cs"
400
- },
401
- "6": {
402
- "name": "storage.modifier.cs"
405
+ "name": "storage.modifier.unsafe.cs"
403
406
  }
404
407
  },
405
408
  "end": "(?=;)",
@@ -410,19 +413,22 @@
410
413
  ]
411
414
  },
412
415
  {
413
- "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(\\b(unsafe)\\b\\s+)?(?=(@?[_[:alpha:]][_[:alnum:]]*)\\s*=)",
416
+ "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*(?:(unsafe)\\b\\s*)?(@?[_[:alpha:]][_[:alnum:]]*)\\s*(=)",
414
417
  "beginCaptures": {
418
+ "1": {
419
+ "name": "keyword.other.directive.global.cs"
420
+ },
415
421
  "2": {
416
- "name": "keyword.other.global.cs"
422
+ "name": "keyword.other.directive.using.cs"
417
423
  },
418
424
  "3": {
419
- "name": "keyword.other.using.cs"
425
+ "name": "storage.modifier.unsafe.cs"
420
426
  },
421
- "5": {
422
- "name": "storage.modifier.cs"
423
- },
424
- "6": {
427
+ "4": {
425
428
  "name": "entity.name.type.alias.cs"
429
+ },
430
+ "5": {
431
+ "name": "keyword.operator.assignment.cs"
426
432
  }
427
433
  },
428
434
  "end": "(?=;)",
@@ -432,20 +438,17 @@
432
438
  },
433
439
  {
434
440
  "include": "#type"
435
- },
436
- {
437
- "include": "#operator-assignment"
438
441
  }
439
442
  ]
440
443
  },
441
444
  {
442
- "begin": "(\\b(global)\\b\\s+)?\\b(using)\\s*(?!\\(|\\s|var)",
445
+ "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*+(?!\\(|var\\b)",
443
446
  "beginCaptures": {
444
- "2": {
445
- "name": "keyword.other.global.cs"
447
+ "1": {
448
+ "name": "keyword.other.directive.global.cs"
446
449
  },
447
- "3": {
448
- "name": "keyword.other.using.cs"
450
+ "2": {
451
+ "name": "keyword.other.directive.using.cs"
449
452
  }
450
453
  },
451
454
  "end": "(?=;)",
@@ -455,7 +458,10 @@
455
458
  },
456
459
  {
457
460
  "name": "entity.name.type.namespace.cs",
458
- "match": "@?[_[:alpha:]][_[:alnum:]]*"
461
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*"
462
+ },
463
+ {
464
+ "include": "#punctuation-accessor"
459
465
  },
460
466
  {
461
467
  "include": "#operator-assignment"
@@ -551,7 +557,7 @@
551
557
  "begin": "\\b(namespace)\\s+",
552
558
  "beginCaptures": {
553
559
  "1": {
554
- "name": "keyword.other.namespace.cs"
560
+ "name": "storage.type.namespace.cs"
555
561
  }
556
562
  },
557
563
  "end": "(?<=\\})|(?=;)",
@@ -594,7 +600,7 @@
594
600
  ]
595
601
  },
596
602
  "storage-modifier": {
597
- "name": "storage.modifier.cs",
603
+ "name": "storage.modifier.$1.cs",
598
604
  "match": "(?<!\\.)\\b(new|public|protected|internal|private|abstract|virtual|override|sealed|static|partial|readonly|volatile|const|extern|async|unsafe|ref|required|file)\\b"
599
605
  },
600
606
  "class-declaration": {
@@ -605,10 +611,10 @@
605
611
  "begin": "(?x)\n(\\b(record)\\b\\s+)?\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*",
606
612
  "beginCaptures": {
607
613
  "2": {
608
- "name": "keyword.other.record.cs"
614
+ "name": "storage.type.record.cs"
609
615
  },
610
616
  "3": {
611
- "name": "keyword.other.class.cs"
617
+ "name": "storage.type.class.cs"
612
618
  },
613
619
  "4": {
614
620
  "name": "entity.name.type.class.cs"
@@ -664,7 +670,7 @@
664
670
  "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(?=\\()",
665
671
  "beginCaptures": {
666
672
  "1": {
667
- "name": "keyword.other.delegate.cs"
673
+ "name": "storage.type.delegate.cs"
668
674
  },
669
675
  "2": {
670
676
  "patterns": [
@@ -712,7 +718,7 @@
712
718
  "match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)",
713
719
  "captures": {
714
720
  "1": {
715
- "name": "keyword.other.enum.cs"
721
+ "name": "storage.type.enum.cs"
716
722
  },
717
723
  "2": {
718
724
  "name": "entity.name.type.enum.cs"
@@ -796,7 +802,7 @@
796
802
  "begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
797
803
  "beginCaptures": {
798
804
  "1": {
799
- "name": "keyword.other.interface.cs"
805
+ "name": "storage.type.interface.cs"
800
806
  },
801
807
  "2": {
802
808
  "name": "entity.name.type.interface.cs"
@@ -853,7 +859,7 @@
853
859
  "begin": "(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
854
860
  "beginCaptures": {
855
861
  "1": {
856
- "name": "keyword.other.record.cs"
862
+ "name": "storage.type.record.cs"
857
863
  },
858
864
  "2": {
859
865
  "name": "entity.name.type.class.cs"
@@ -913,10 +919,10 @@
913
919
  "begin": "(?x)\n(\\b(record)\\b\\s+)?\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
914
920
  "beginCaptures": {
915
921
  "2": {
916
- "name": "keyword.other.record.cs"
922
+ "name": "storage.type.record.cs"
917
923
  },
918
924
  "3": {
919
- "name": "keyword.other.struct.cs"
925
+ "name": "storage.type.struct.cs"
920
926
  },
921
927
  "4": {
922
928
  "name": "entity.name.type.struct.cs"
@@ -984,19 +990,11 @@
984
990
  "patterns": [
985
991
  {
986
992
  "match": "\\b(in|out)\\b",
987
- "captures": {
988
- "1": {
989
- "name": "storage.modifier.cs"
990
- }
991
- }
993
+ "name": "storage.modifier.$1.cs"
992
994
  },
993
995
  {
994
996
  "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b",
995
- "captures": {
996
- "1": {
997
- "name": "entity.name.type.type-parameter.cs"
998
- }
999
- }
997
+ "name": "entity.name.type.type-parameter.cs"
1000
998
  },
1001
999
  {
1002
1000
  "include": "#comment"
@@ -1033,7 +1031,7 @@
1033
1031
  "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
1034
1032
  "beginCaptures": {
1035
1033
  "1": {
1036
- "name": "keyword.other.where.cs"
1034
+ "name": "storage.modifier.where.cs"
1037
1035
  },
1038
1036
  "2": {
1039
1037
  "name": "entity.name.type.type-parameter.cs"
@@ -1045,18 +1043,18 @@
1045
1043
  "end": "(?=\\{|where|;|=>)",
1046
1044
  "patterns": [
1047
1045
  {
1048
- "name": "keyword.other.class.cs",
1046
+ "name": "storage.type.class.cs",
1049
1047
  "match": "\\bclass\\b"
1050
1048
  },
1051
1049
  {
1052
- "name": "keyword.other.struct.cs",
1050
+ "name": "storage.type.struct.cs",
1053
1051
  "match": "\\bstruct\\b"
1054
1052
  },
1055
1053
  {
1056
1054
  "match": "(new)\\s*(\\()\\s*(\\))",
1057
1055
  "captures": {
1058
1056
  "1": {
1059
- "name": "keyword.other.new.cs"
1057
+ "name": "keyword.operator.expression.new.cs"
1060
1058
  },
1061
1059
  "2": {
1062
1060
  "name": "punctuation.parenthesis.open.cs"
@@ -1112,7 +1110,7 @@
1112
1110
  ]
1113
1111
  },
1114
1112
  "property-declaration": {
1115
- "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(?=\\{|=>|$)",
1113
+ "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(?=\\{|=>|//|/\\*|$)",
1116
1114
  "beginCaptures": {
1117
1115
  "1": {
1118
1116
  "patterns": [
@@ -1144,7 +1142,7 @@
1144
1142
  "include": "#property-accessors"
1145
1143
  },
1146
1144
  {
1147
- "include": "#expression-body"
1145
+ "include": "#accessor-getter-expression"
1148
1146
  },
1149
1147
  {
1150
1148
  "include": "#variable-initializer"
@@ -1175,7 +1173,7 @@
1175
1173
  ]
1176
1174
  },
1177
1175
  "8": {
1178
- "name": "keyword.other.this.cs"
1176
+ "name": "variable.language.this.cs"
1179
1177
  }
1180
1178
  },
1181
1179
  "end": "(?<=\\})|(?=;)",
@@ -1190,7 +1188,7 @@
1190
1188
  "include": "#property-accessors"
1191
1189
  },
1192
1190
  {
1193
- "include": "#expression-body"
1191
+ "include": "#accessor-getter-expression"
1194
1192
  },
1195
1193
  {
1196
1194
  "include": "#variable-initializer"
@@ -1198,10 +1196,10 @@
1198
1196
  ]
1199
1197
  },
1200
1198
  "event-declaration": {
1201
- "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(?<event_names>\\g<identifier>(?:\\s*,\\s*\\g<identifier>)*)\\s*\n(?=\\{|;|$)",
1199
+ "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(?=\\{|;|,|=|//|/\\*|$)",
1202
1200
  "beginCaptures": {
1203
1201
  "1": {
1204
- "name": "keyword.other.event.cs"
1202
+ "name": "storage.type.event.cs"
1205
1203
  },
1206
1204
  "2": {
1207
1205
  "patterns": [
@@ -1221,15 +1219,7 @@
1221
1219
  ]
1222
1220
  },
1223
1221
  "9": {
1224
- "patterns": [
1225
- {
1226
- "name": "entity.name.variable.event.cs",
1227
- "match": "@?[_[:alpha:]][_[:alnum:]]*"
1228
- },
1229
- {
1230
- "include": "#punctuation-comma"
1231
- }
1232
- ]
1222
+ "name": "entity.name.variable.event.cs"
1233
1223
  }
1234
1224
  },
1235
1225
  "end": "(?<=\\})|(?=;)",
@@ -1240,8 +1230,29 @@
1240
1230
  {
1241
1231
  "include": "#event-accessors"
1242
1232
  },
1233
+ {
1234
+ "name": "entity.name.variable.event.cs",
1235
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
1236
+ },
1243
1237
  {
1244
1238
  "include": "#punctuation-comma"
1239
+ },
1240
+ {
1241
+ "begin": "=",
1242
+ "beginCaptures": {
1243
+ "0": {
1244
+ "name": "keyword.operator.assignment.cs"
1245
+ }
1246
+ },
1247
+ "end": "(?<=,)|(?=;)",
1248
+ "patterns": [
1249
+ {
1250
+ "include": "#expression"
1251
+ },
1252
+ {
1253
+ "include": "#punctuation-comma"
1254
+ }
1255
+ ]
1245
1256
  }
1246
1257
  ]
1247
1258
  },
@@ -1259,22 +1270,6 @@
1259
1270
  }
1260
1271
  },
1261
1272
  "patterns": [
1262
- {
1263
- "name": "storage.modifier.cs",
1264
- "match": "\\b(private|protected|internal)\\b"
1265
- },
1266
- {
1267
- "name": "keyword.other.get.cs",
1268
- "match": "\\b(get)\\b"
1269
- },
1270
- {
1271
- "name": "keyword.other.set.cs",
1272
- "match": "\\b(set)\\b"
1273
- },
1274
- {
1275
- "name": "keyword.other.init.cs",
1276
- "match": "\\b(init)\\b"
1277
- },
1278
1273
  {
1279
1274
  "include": "#comment"
1280
1275
  },
@@ -1282,13 +1277,36 @@
1282
1277
  "include": "#attribute-section"
1283
1278
  },
1284
1279
  {
1285
- "include": "#expression-body"
1280
+ "name": "storage.modifier.$1.cs",
1281
+ "match": "\\b(private|protected|internal)\\b"
1286
1282
  },
1287
1283
  {
1288
- "include": "#block"
1284
+ "begin": "\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1285
+ "beginCaptures": {
1286
+ "1": {
1287
+ "name": "storage.type.accessor.$1.cs"
1288
+ }
1289
+ },
1290
+ "end": "(?<=\\}|;)|(?=\\})",
1291
+ "patterns": [
1292
+ {
1293
+ "include": "#accessor-getter"
1294
+ }
1295
+ ]
1289
1296
  },
1290
1297
  {
1291
- "include": "#punctuation-semicolon"
1298
+ "begin": "\\b(set|init)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1299
+ "beginCaptures": {
1300
+ "1": {
1301
+ "name": "storage.type.accessor.$1.cs"
1302
+ }
1303
+ },
1304
+ "end": "(?<=\\}|;)|(?=\\})",
1305
+ "patterns": [
1306
+ {
1307
+ "include": "#accessor-setter"
1308
+ }
1309
+ ]
1292
1310
  }
1293
1311
  ]
1294
1312
  },
@@ -1307,24 +1325,114 @@
1307
1325
  },
1308
1326
  "patterns": [
1309
1327
  {
1310
- "name": "keyword.other.add.cs",
1311
- "match": "\\b(add)\\b"
1328
+ "include": "#comment"
1312
1329
  },
1313
1330
  {
1314
- "name": "keyword.other.remove.cs",
1315
- "match": "\\b(remove)\\b"
1331
+ "include": "#attribute-section"
1316
1332
  },
1317
1333
  {
1318
- "include": "#comment"
1334
+ "begin": "\\b(add|remove)\\b\\s*(?=\\{|;|=>|//|/\\*|$)",
1335
+ "beginCaptures": {
1336
+ "1": {
1337
+ "name": "storage.type.accessor.$1.cs"
1338
+ }
1339
+ },
1340
+ "end": "(?<=\\}|;)|(?=\\})",
1341
+ "patterns": [
1342
+ {
1343
+ "include": "#accessor-setter"
1344
+ }
1345
+ ]
1346
+ }
1347
+ ]
1348
+ },
1349
+ "accessor-getter": {
1350
+ "patterns": [
1351
+ {
1352
+ "begin": "\\{",
1353
+ "beginCaptures": {
1354
+ "0": {
1355
+ "name": "punctuation.curlybrace.open.cs"
1356
+ }
1357
+ },
1358
+ "end": "\\}",
1359
+ "endCaptures": {
1360
+ "0": {
1361
+ "name": "punctuation.curlybrace.close.cs"
1362
+ }
1363
+ },
1364
+ "contentName": "meta.accessor.getter.cs",
1365
+ "patterns": [
1366
+ {
1367
+ "include": "#statement"
1368
+ }
1369
+ ]
1319
1370
  },
1320
1371
  {
1321
- "include": "#attribute-section"
1372
+ "include": "#accessor-getter-expression"
1322
1373
  },
1323
1374
  {
1324
- "include": "#expression-body"
1375
+ "include": "#punctuation-semicolon"
1376
+ }
1377
+ ]
1378
+ },
1379
+ "accessor-getter-expression": {
1380
+ "begin": "=>",
1381
+ "beginCaptures": {
1382
+ "0": {
1383
+ "name": "keyword.operator.arrow.cs"
1384
+ }
1385
+ },
1386
+ "end": "(?=;|\\})",
1387
+ "contentName": "meta.accessor.getter.cs",
1388
+ "patterns": [
1389
+ {
1390
+ "include": "#ref-modifier"
1325
1391
  },
1326
1392
  {
1327
- "include": "#block"
1393
+ "include": "#expression"
1394
+ }
1395
+ ]
1396
+ },
1397
+ "accessor-setter": {
1398
+ "patterns": [
1399
+ {
1400
+ "begin": "\\{",
1401
+ "beginCaptures": {
1402
+ "0": {
1403
+ "name": "punctuation.curlybrace.open.cs"
1404
+ }
1405
+ },
1406
+ "end": "\\}",
1407
+ "endCaptures": {
1408
+ "0": {
1409
+ "name": "punctuation.curlybrace.close.cs"
1410
+ }
1411
+ },
1412
+ "contentName": "meta.accessor.setter.cs",
1413
+ "patterns": [
1414
+ {
1415
+ "include": "#statement"
1416
+ }
1417
+ ]
1418
+ },
1419
+ {
1420
+ "begin": "=>",
1421
+ "beginCaptures": {
1422
+ "0": {
1423
+ "name": "keyword.operator.arrow.cs"
1424
+ }
1425
+ },
1426
+ "end": "(?=;|\\})",
1427
+ "contentName": "meta.accessor.setter.cs",
1428
+ "patterns": [
1429
+ {
1430
+ "include": "#ref-modifier"
1431
+ },
1432
+ {
1433
+ "include": "#expression"
1434
+ }
1435
+ ]
1328
1436
  },
1329
1437
  {
1330
1438
  "include": "#punctuation-semicolon"
@@ -1425,13 +1533,10 @@
1425
1533
  ]
1426
1534
  },
1427
1535
  "constructor-initializer": {
1428
- "begin": "\\b(?:(base)|(this))\\b\\s*(?=\\()",
1536
+ "begin": "\\b(base|this)\\b\\s*(?=\\()",
1429
1537
  "beginCaptures": {
1430
1538
  "1": {
1431
- "name": "keyword.other.base.cs"
1432
- },
1433
- "2": {
1434
- "name": "keyword.other.this.cs"
1539
+ "name": "variable.language.$1.cs"
1435
1540
  }
1436
1541
  },
1437
1542
  "end": "(?<=\\))",
@@ -1468,7 +1573,7 @@
1468
1573
  ]
1469
1574
  },
1470
1575
  "operator-declaration": {
1471
- "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(?<operator_keyword>(?:\\b(?:operator)))\\s*\n(?<operator>(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()",
1576
+ "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(?=\\()",
1472
1577
  "beginCaptures": {
1473
1578
  "1": {
1474
1579
  "patterns": [
@@ -1478,7 +1583,7 @@
1478
1583
  ]
1479
1584
  },
1480
1585
  "6": {
1481
- "name": "keyword.other.operator-decl.cs"
1586
+ "name": "storage.type.operator.cs"
1482
1587
  },
1483
1588
  "7": {
1484
1589
  "name": "entity.name.function.cs"
@@ -1509,7 +1614,7 @@
1509
1614
  "match": "\\b(explicit)\\b",
1510
1615
  "captures": {
1511
1616
  "1": {
1512
- "name": "keyword.other.explicit.cs"
1617
+ "name": "storage.modifier.explicit.cs"
1513
1618
  }
1514
1619
  }
1515
1620
  },
@@ -1517,14 +1622,14 @@
1517
1622
  "match": "\\b(implicit)\\b",
1518
1623
  "captures": {
1519
1624
  "1": {
1520
- "name": "keyword.other.implicit.cs"
1625
+ "name": "storage.modifier.implicit.cs"
1521
1626
  }
1522
1627
  }
1523
1628
  }
1524
1629
  ]
1525
1630
  },
1526
1631
  "2": {
1527
- "name": "keyword.other.operator-decl.cs"
1632
+ "name": "storage.type.operator.cs"
1528
1633
  },
1529
1634
  "3": {
1530
1635
  "patterns": [
@@ -1607,19 +1712,19 @@
1607
1712
  "begin": "(?<!\\.)\\b(goto)\\b",
1608
1713
  "beginCaptures": {
1609
1714
  "1": {
1610
- "name": "keyword.control.goto.cs"
1715
+ "name": "keyword.control.flow.goto.cs"
1611
1716
  }
1612
1717
  },
1613
- "end": "(?=;)",
1718
+ "end": "(?=[;}])",
1614
1719
  "patterns": [
1615
1720
  {
1616
1721
  "begin": "\\b(case)\\b",
1617
1722
  "beginCaptures": {
1618
1723
  "1": {
1619
- "name": "keyword.control.case.cs"
1724
+ "name": "keyword.control.conditional.case.cs"
1620
1725
  }
1621
1726
  },
1622
- "end": "(?=;)",
1727
+ "end": "(?=[;}])",
1623
1728
  "patterns": [
1624
1729
  {
1625
1730
  "include": "#expression"
@@ -1630,7 +1735,7 @@
1630
1735
  "match": "\\b(default)\\b",
1631
1736
  "captures": {
1632
1737
  "1": {
1633
- "name": "keyword.control.default.cs"
1738
+ "name": "keyword.control.conditional.default.cs"
1634
1739
  }
1635
1740
  }
1636
1741
  },
@@ -1647,7 +1752,7 @@
1647
1752
  "name": "keyword.control.flow.return.cs"
1648
1753
  }
1649
1754
  },
1650
- "end": "(?=;)",
1755
+ "end": "(?=[;}])",
1651
1756
  "patterns": [
1652
1757
  {
1653
1758
  "include": "#ref-modifier"
@@ -1658,15 +1763,8 @@
1658
1763
  ]
1659
1764
  },
1660
1765
  "break-or-continue-statement": {
1661
- "match": "(?<!\\.)\\b(?:(break)|(continue))\\b",
1662
- "captures": {
1663
- "1": {
1664
- "name": "keyword.control.flow.break.cs"
1665
- },
1666
- "2": {
1667
- "name": "keyword.control.flow.continue.cs"
1668
- }
1669
- }
1766
+ "match": "(?<!\\.)\\b(break|continue)\\b",
1767
+ "name": "keyword.control.flow.$1.cs"
1670
1768
  },
1671
1769
  "throw-statement": {
1672
1770
  "begin": "(?<!\\.)\\b(throw)\\b",
@@ -1675,7 +1773,7 @@
1675
1773
  "name": "keyword.control.flow.throw.cs"
1676
1774
  }
1677
1775
  },
1678
- "end": "(?=;)",
1776
+ "end": "(?=[;}])",
1679
1777
  "patterns": [
1680
1778
  {
1681
1779
  "include": "#expression"
@@ -1702,7 +1800,7 @@
1702
1800
  "name": "keyword.control.flow.return.cs"
1703
1801
  }
1704
1802
  },
1705
- "end": "(?=;)",
1803
+ "end": "(?=[;}])",
1706
1804
  "patterns": [
1707
1805
  {
1708
1806
  "include": "#expression"
@@ -1721,16 +1819,22 @@
1721
1819
  }
1722
1820
  },
1723
1821
  "await-statement": {
1724
- "begin": "(?<!\\.)\\b(await)\\b",
1822
+ "begin": "(?<!\\.\\s*)\\b(await)\\b",
1725
1823
  "beginCaptures": {
1726
1824
  "1": {
1727
- "name": "keyword.other.await.cs"
1825
+ "name": "keyword.operator.expression.await.cs"
1728
1826
  }
1729
1827
  },
1730
- "end": "(?=;)",
1828
+ "end": "(?<=})|(?=;|})",
1731
1829
  "patterns": [
1732
1830
  {
1733
- "include": "#statement"
1831
+ "include": "#foreach-statement"
1832
+ },
1833
+ {
1834
+ "include": "#using-statement"
1835
+ },
1836
+ {
1837
+ "include": "#expression"
1734
1838
  }
1735
1839
  ]
1736
1840
  },
@@ -1741,7 +1845,7 @@
1741
1845
  "name": "keyword.control.conditional.if.cs"
1742
1846
  }
1743
1847
  },
1744
- "end": "(?<=\\})|(?=;)",
1848
+ "end": "(?<=})|(?=;)",
1745
1849
  "patterns": [
1746
1850
  {
1747
1851
  "begin": "\\(",
@@ -1774,22 +1878,50 @@
1774
1878
  "name": "keyword.control.conditional.else.cs"
1775
1879
  }
1776
1880
  },
1777
- "end": "(?<=\\})|(?=;)",
1881
+ "end": "(?<=})|(?=;)",
1778
1882
  "patterns": [
1779
1883
  {
1780
1884
  "include": "#statement"
1781
1885
  }
1782
1886
  ]
1783
1887
  },
1784
- "switch-statement": {
1785
- "begin": "(?<!\\.)\\b(switch)\\b\\s*(?=\\()",
1888
+ "switch-statement-or-expression": {
1889
+ "begin": "(?<!\\.)\\b(switch)\\b",
1786
1890
  "beginCaptures": {
1787
1891
  "1": {
1788
- "name": "keyword.control.switch.cs"
1892
+ "name": "keyword.control.conditional.switch.cs"
1789
1893
  }
1790
1894
  },
1791
- "end": "(?<=\\})",
1895
+ "end": "(?<=})|(?=})",
1896
+ "patterns": [
1897
+ {
1898
+ "include": "#intrusive"
1899
+ },
1900
+ {
1901
+ "begin": "(?=\\()",
1902
+ "end": "(?<=\\})|(?=\\})",
1903
+ "patterns": [
1904
+ {
1905
+ "include": "#switch-statement"
1906
+ }
1907
+ ]
1908
+ },
1909
+ {
1910
+ "begin": "(?=\\{)",
1911
+ "end": "(?<=\\})|(?=\\})",
1912
+ "patterns": [
1913
+ {
1914
+ "include": "#switch-expression"
1915
+ }
1916
+ ]
1917
+ }
1918
+ ]
1919
+ },
1920
+ "switch-statement": {
1792
1921
  "patterns": [
1922
+ {
1923
+ "include": "#intrusive"
1924
+ },
1793
1925
  {
1794
1926
  "begin": "\\(",
1795
1927
  "beginCaptures": {
@@ -1833,212 +1965,602 @@
1833
1965
  }
1834
1966
  ]
1835
1967
  },
1836
- "switch-expression": {
1837
- "begin": "(?x) (?<!\\.)\\b(switch)\\b",
1968
+ "switch-label": {
1969
+ "begin": "\\b(case|default)\\b",
1838
1970
  "beginCaptures": {
1839
1971
  "1": {
1840
- "name": "keyword.control.switch.cs"
1972
+ "name": "keyword.control.conditional.$1.cs"
1841
1973
  }
1842
1974
  },
1843
- "end": "(?<=\\})",
1975
+ "end": "(:)|(?=})",
1844
1976
  "endCaptures": {
1845
- "0": {
1846
- "name": "punctuation.curlybrace.close.cs"
1977
+ "1": {
1978
+ "name": "punctuation.separator.colon.cs"
1847
1979
  }
1848
1980
  },
1849
1981
  "patterns": [
1850
1982
  {
1851
- "begin": "\\{",
1983
+ "begin": "\\b(when)\\b",
1852
1984
  "beginCaptures": {
1853
- "0": {
1854
- "name": "punctuation.curlybrace.open.cs"
1855
- }
1856
- },
1857
- "end": "\\}",
1858
- "endCaptures": {
1859
- "0": {
1860
- "name": "punctuation.curlybrace.close.cs"
1985
+ "1": {
1986
+ "name": "keyword.control.conditional.when.cs"
1861
1987
  }
1862
1988
  },
1989
+ "end": "(?=:|})",
1863
1990
  "patterns": [
1864
1991
  {
1865
- "include": "#comment"
1866
- },
1867
- {
1868
- "include": "#literal"
1869
- },
1870
- {
1871
- "include": "#switch-var-pattern"
1872
- },
1873
- {
1874
- "include": "#switch-property-expression"
1875
- },
1876
- {
1877
- "include": "#member-access-expression"
1878
- },
1879
- {
1880
- "include": "#switch-pattern"
1881
- },
1882
- {
1883
- "include": "#expression-body"
1884
- },
1992
+ "include": "#case-guard"
1993
+ }
1994
+ ]
1995
+ },
1996
+ {
1997
+ "begin": "(?!\\s)",
1998
+ "end": "(?=\\bwhen\\b|:|})",
1999
+ "patterns": [
1885
2000
  {
1886
- "include": "#punctuation-comma"
2001
+ "include": "#pattern"
1887
2002
  }
1888
2003
  ]
1889
2004
  }
1890
2005
  ]
1891
2006
  },
1892
- "switch-pattern": {
1893
- "begin": "(?x) # e.g. int x OR var 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\\s*",
2007
+ "switch-expression": {
2008
+ "begin": "\\{",
1894
2009
  "beginCaptures": {
1895
- "1": {
2010
+ "0": {
2011
+ "name": "punctuation.curlybrace.open.cs"
2012
+ }
2013
+ },
2014
+ "end": "\\}",
2015
+ "endCaptures": {
2016
+ "0": {
2017
+ "name": "punctuation.curlybrace.close.cs"
2018
+ }
2019
+ },
2020
+ "patterns": [
2021
+ {
2022
+ "include": "#punctuation-comma"
2023
+ },
2024
+ {
2025
+ "begin": "=>",
2026
+ "beginCaptures": {
2027
+ "0": {
2028
+ "name": "keyword.operator.arrow.cs"
2029
+ }
2030
+ },
2031
+ "end": "(?=,|})",
1896
2032
  "patterns": [
1897
2033
  {
1898
- "include": "#type"
2034
+ "include": "#expression"
1899
2035
  }
1900
2036
  ]
1901
2037
  },
1902
- "2": {
1903
- "name": "entity.name.variable.local.cs"
2038
+ {
2039
+ "begin": "\\b(when)\\b",
2040
+ "beginCaptures": {
2041
+ "1": {
2042
+ "name": "keyword.control.conditional.when.cs"
2043
+ }
2044
+ },
2045
+ "end": "(?==>|,|})",
2046
+ "patterns": [
2047
+ {
2048
+ "include": "#case-guard"
2049
+ }
2050
+ ]
2051
+ },
2052
+ {
2053
+ "begin": "(?!\\s)",
2054
+ "end": "(?=\\bwhen\\b|=>|,|})",
2055
+ "patterns": [
2056
+ {
2057
+ "include": "#pattern"
2058
+ }
2059
+ ]
2060
+ }
2061
+ ]
2062
+ },
2063
+ "case-guard": {
2064
+ "patterns": [
2065
+ {
2066
+ "include": "#parenthesized-expression"
2067
+ },
2068
+ {
2069
+ "include": "#expression"
2070
+ }
2071
+ ]
2072
+ },
2073
+ "is-expression": {
2074
+ "begin": "(?<!\\.)\\b(is)\\b",
2075
+ "beginCaptures": {
2076
+ "1": {
2077
+ "name": "keyword.operator.expression.pattern.is.cs"
1904
2078
  }
1905
2079
  },
1906
- "end": "(?==>)",
2080
+ "end": "(?=[)}\\],;:?=&|^]|!=)",
1907
2081
  "patterns": [
1908
2082
  {
1909
- "include": "#comment"
2083
+ "include": "#pattern"
2084
+ }
2085
+ ]
2086
+ },
2087
+ "pattern": {
2088
+ "patterns": [
2089
+ {
2090
+ "include": "#intrusive"
2091
+ },
2092
+ {
2093
+ "include": "#combinator-pattern"
2094
+ },
2095
+ {
2096
+ "include": "#discard-pattern"
2097
+ },
2098
+ {
2099
+ "include": "#constant-pattern"
2100
+ },
2101
+ {
2102
+ "include": "#relational-pattern"
2103
+ },
2104
+ {
2105
+ "include": "#var-pattern"
2106
+ },
2107
+ {
2108
+ "include": "#type-pattern"
2109
+ },
2110
+ {
2111
+ "include": "#positional-pattern"
2112
+ },
2113
+ {
2114
+ "include": "#property-pattern"
1910
2115
  },
1911
2116
  {
1912
- "include": "#switch-when-clause"
2117
+ "include": "#list-pattern"
2118
+ },
2119
+ {
2120
+ "include": "#slice-pattern"
1913
2121
  }
1914
2122
  ]
1915
2123
  },
1916
- "switch-property-expression": {
1917
- "begin": "(?x) # e.g. int x OR var 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(\\{)",
2124
+ "combinator-pattern": {
2125
+ "match": "\\b(and|or|not)\\b",
2126
+ "name": "keyword.operator.expression.pattern.combinator.$1.cs"
2127
+ },
2128
+ "discard-pattern": {
2129
+ "match": "_(?![_[:alnum:]])",
2130
+ "name": "variable.language.discard.cs"
2131
+ },
2132
+ "constant-pattern": {
2133
+ "patterns": [
2134
+ {
2135
+ "include": "#boolean-literal"
2136
+ },
2137
+ {
2138
+ "include": "#null-literal"
2139
+ },
2140
+ {
2141
+ "include": "#numeric-literal"
2142
+ },
2143
+ {
2144
+ "include": "#char-literal"
2145
+ },
2146
+ {
2147
+ "include": "#string-literal"
2148
+ },
2149
+ {
2150
+ "include": "#raw-string-literal"
2151
+ },
2152
+ {
2153
+ "include": "#verbatim-string-literal"
2154
+ },
2155
+ {
2156
+ "include": "#type-operator-expression"
2157
+ },
2158
+ {
2159
+ "include": "#expression-operator-expression"
2160
+ },
2161
+ {
2162
+ "include": "#expression-operators"
2163
+ },
2164
+ {
2165
+ "include": "#casted-constant-pattern"
2166
+ }
2167
+ ]
2168
+ },
2169
+ "casted-constant-pattern": {
2170
+ "begin": "(?x)\n(\\()\n ([\\s.:@_[:alnum:]]+)\n(\\))\n(?=[\\s+\\-!~]*@?[_[:alnum:]('\"]+)",
1918
2171
  "beginCaptures": {
1919
2172
  "1": {
2173
+ "name": "punctuation.parenthesis.open.cs"
2174
+ },
2175
+ "2": {
1920
2176
  "patterns": [
1921
2177
  {
1922
- "include": "#type"
2178
+ "include": "#type-builtin"
2179
+ },
2180
+ {
2181
+ "include": "#type-name"
1923
2182
  }
1924
2183
  ]
1925
2184
  },
1926
- "6": {
1927
- "name": "punctuation.curlybrace.open.cs"
2185
+ "3": {
2186
+ "name": "punctuation.parenthesis.close.cs"
1928
2187
  }
1929
2188
  },
1930
- "end": "\\}",
1931
- "endCaptures": {
2189
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2190
+ "patterns": [
2191
+ {
2192
+ "include": "#casted-constant-pattern"
2193
+ },
2194
+ {
2195
+ "begin": "\\(",
2196
+ "beginCaptures": {
2197
+ "0": {
2198
+ "name": "punctuation.parenthesis.open.cs"
2199
+ }
2200
+ },
2201
+ "end": "\\)",
2202
+ "endCaptures": {
2203
+ "0": {
2204
+ "name": "punctuation.parenthesis.close.cs"
2205
+ }
2206
+ },
2207
+ "patterns": [
2208
+ {
2209
+ "include": "#constant-pattern"
2210
+ }
2211
+ ]
2212
+ },
2213
+ {
2214
+ "include": "#constant-pattern"
2215
+ },
2216
+ {
2217
+ "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)",
2218
+ "captures": {
2219
+ "1": {
2220
+ "name": "entity.name.type.alias.cs"
2221
+ },
2222
+ "2": {
2223
+ "name": "punctuation.separator.coloncolon.cs"
2224
+ }
2225
+ }
2226
+ },
2227
+ {
2228
+ "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)",
2229
+ "captures": {
2230
+ "1": {
2231
+ "name": "entity.name.type.cs"
2232
+ },
2233
+ "2": {
2234
+ "name": "punctuation.accessor.cs"
2235
+ }
2236
+ }
2237
+ },
2238
+ {
2239
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2240
+ "name": "variable.other.constant.cs"
2241
+ }
2242
+ ]
2243
+ },
2244
+ "relational-pattern": {
2245
+ "begin": "<=?|>=?",
2246
+ "beginCaptures": {
1932
2247
  "0": {
1933
- "name": "punctuation.curlybrace.close.cs"
2248
+ "name": "keyword.operator.relational.cs"
1934
2249
  }
1935
2250
  },
2251
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
1936
2252
  "patterns": [
1937
2253
  {
1938
2254
  "include": "#expression"
1939
- },
1940
- {
1941
- "include": "#punctuation-comma"
1942
2255
  }
1943
2256
  ]
1944
2257
  },
1945
- "switch-var-pattern": {
1946
- "begin": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s*",
2258
+ "var-pattern": {
2259
+ "begin": "\\b(var)\\b",
1947
2260
  "beginCaptures": {
1948
2261
  "1": {
1949
- "name": "keyword.other.var.cs"
2262
+ "name": "storage.type.var.cs"
2263
+ }
2264
+ },
2265
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2266
+ "patterns": [
2267
+ {
2268
+ "include": "#designation-pattern"
2269
+ }
2270
+ ]
2271
+ },
2272
+ "designation-pattern": {
2273
+ "patterns": [
2274
+ {
2275
+ "include": "#intrusive"
1950
2276
  },
1951
- "2": {
2277
+ {
2278
+ "begin": "\\(",
2279
+ "beginCaptures": {
2280
+ "0": {
2281
+ "name": "punctuation.parenthesis.open.cs"
2282
+ }
2283
+ },
2284
+ "end": "\\)",
2285
+ "endCaptures": {
2286
+ "0": {
2287
+ "name": "punctuation.parenthesis.close.cs"
2288
+ }
2289
+ },
1952
2290
  "patterns": [
1953
2291
  {
1954
- "include": "#tuple-declaration-deconstruction-element-list"
2292
+ "include": "#punctuation-comma"
2293
+ },
2294
+ {
2295
+ "include": "#designation-pattern"
1955
2296
  }
1956
2297
  ]
2298
+ },
2299
+ {
2300
+ "include": "#simple-designation-pattern"
1957
2301
  }
1958
- },
1959
- "end": "(?==>)",
2302
+ ]
2303
+ },
2304
+ "simple-designation-pattern": {
1960
2305
  "patterns": [
1961
2306
  {
1962
- "include": "#comment"
2307
+ "include": "#discard-pattern"
1963
2308
  },
1964
2309
  {
1965
- "include": "#switch-when-clause"
2310
+ "match": "@?[_[:alpha:]][_[:alnum:]]*",
2311
+ "name": "entity.name.variable.local.cs"
1966
2312
  }
1967
2313
  ]
1968
2314
  },
1969
- "switch-when-clause": {
1970
- "begin": "(?<!\\.)\\b(when)\\b\\s*(\\()?",
1971
- "beginCaptures": {
1972
- "1": {
1973
- "name": "keyword.control.try.when.cs"
2315
+ "type-pattern": {
2316
+ "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*)",
2317
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2318
+ "patterns": [
2319
+ {
2320
+ "begin": "\\G",
2321
+ "end": "(?!\\G[@_[:alpha:]])(?=[\\({@_[:alpha:])}\\],;:=&|^]|(?:\\s|^)\\?|!=|\\b(and|or|when)\\b)",
2322
+ "patterns": [
2323
+ {
2324
+ "include": "#intrusive"
2325
+ },
2326
+ {
2327
+ "include": "#type-subpattern"
2328
+ }
2329
+ ]
1974
2330
  },
1975
- "2": {
1976
- "name": "punctuation.parenthesis.open.cs"
2331
+ {
2332
+ "begin": "(?=[\\({@_[:alpha:]])",
2333
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2334
+ "patterns": [
2335
+ {
2336
+ "include": "#intrusive"
2337
+ },
2338
+ {
2339
+ "include": "#positional-pattern"
2340
+ },
2341
+ {
2342
+ "include": "#property-pattern"
2343
+ },
2344
+ {
2345
+ "include": "#simple-designation-pattern"
2346
+ }
2347
+ ]
1977
2348
  }
1978
- },
1979
- "end": "(?==>)",
2349
+ ]
2350
+ },
2351
+ "type-subpattern": {
1980
2352
  "patterns": [
1981
2353
  {
1982
- "include": "#comment"
2354
+ "include": "#type-builtin"
1983
2355
  },
1984
2356
  {
1985
- "include": "#expression"
2357
+ "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(::)",
2358
+ "beginCaptures": {
2359
+ "1": {
2360
+ "name": "entity.name.type.alias.cs"
2361
+ },
2362
+ "2": {
2363
+ "name": "punctuation.separator.coloncolon.cs"
2364
+ }
2365
+ },
2366
+ "end": "(?<=[_[:alnum:]])|(?=[.<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2367
+ "patterns": [
2368
+ {
2369
+ "include": "#intrusive"
2370
+ },
2371
+ {
2372
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2373
+ "name": "entity.name.type.cs"
2374
+ }
2375
+ ]
1986
2376
  },
1987
2377
  {
1988
- "include": "#punctuation-comma"
2378
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2379
+ "name": "entity.name.type.cs"
1989
2380
  },
1990
2381
  {
1991
- "match": "\\(",
1992
- "captures": {
2382
+ "begin": "\\.",
2383
+ "beginCaptures": {
1993
2384
  "0": {
1994
- "name": "punctuation.parenthesis.open.cs"
2385
+ "name": "punctuation.accessor.cs"
1995
2386
  }
1996
- }
2387
+ },
2388
+ "end": "(?<=[_[:alnum:]])|(?=[<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2389
+ "patterns": [
2390
+ {
2391
+ "include": "#intrusive"
2392
+ },
2393
+ {
2394
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2395
+ "name": "entity.name.type.cs"
2396
+ }
2397
+ ]
1997
2398
  },
1998
2399
  {
1999
- "match": "\\)",
2000
- "captures": {
2400
+ "include": "#type-arguments"
2401
+ },
2402
+ {
2403
+ "include": "#type-array-suffix"
2404
+ },
2405
+ {
2406
+ "match": "(?<!\\s)\\?",
2407
+ "name": "punctuation.separator.question-mark.cs"
2408
+ }
2409
+ ]
2410
+ },
2411
+ "positional-pattern": {
2412
+ "begin": "(?=\\()",
2413
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2414
+ "patterns": [
2415
+ {
2416
+ "begin": "\\(",
2417
+ "beginCaptures": {
2418
+ "0": {
2419
+ "name": "punctuation.parenthesis.open.cs"
2420
+ }
2421
+ },
2422
+ "end": "\\)",
2423
+ "endCaptures": {
2001
2424
  "0": {
2002
2425
  "name": "punctuation.parenthesis.close.cs"
2003
2426
  }
2004
- }
2427
+ },
2428
+ "patterns": [
2429
+ {
2430
+ "include": "#subpattern"
2431
+ },
2432
+ {
2433
+ "include": "#punctuation-comma"
2434
+ }
2435
+ ]
2436
+ },
2437
+ {
2438
+ "begin": "(?<=\\))",
2439
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2440
+ "patterns": [
2441
+ {
2442
+ "include": "#intrusive"
2443
+ },
2444
+ {
2445
+ "include": "#property-pattern"
2446
+ },
2447
+ {
2448
+ "include": "#simple-designation-pattern"
2449
+ }
2450
+ ]
2005
2451
  }
2006
2452
  ]
2007
2453
  },
2008
- "switch-label": {
2454
+ "property-pattern": {
2455
+ "begin": "(?={)",
2456
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2009
2457
  "patterns": [
2010
2458
  {
2011
- "begin": "(?<!\\.)\\b(case)\\b\\s+",
2459
+ "begin": "\\{",
2012
2460
  "beginCaptures": {
2013
- "1": {
2014
- "name": "keyword.control.case.cs"
2461
+ "0": {
2462
+ "name": "punctuation.curlybrace.open.cs"
2015
2463
  }
2016
2464
  },
2017
- "end": ":",
2465
+ "end": "\\}",
2018
2466
  "endCaptures": {
2019
2467
  "0": {
2020
- "name": "punctuation.separator.colon.cs"
2468
+ "name": "punctuation.curlybrace.close.cs"
2021
2469
  }
2022
2470
  },
2023
2471
  "patterns": [
2024
2472
  {
2025
- "include": "#expression"
2473
+ "include": "#subpattern"
2474
+ },
2475
+ {
2476
+ "include": "#punctuation-comma"
2026
2477
  }
2027
2478
  ]
2028
2479
  },
2029
2480
  {
2030
- "match": "(?<!\\.)\\b(default)\\b\\s*(:)",
2481
+ "begin": "(?<=\\})",
2482
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2483
+ "patterns": [
2484
+ {
2485
+ "include": "#intrusive"
2486
+ },
2487
+ {
2488
+ "include": "#simple-designation-pattern"
2489
+ }
2490
+ ]
2491
+ }
2492
+ ]
2493
+ },
2494
+ "subpattern": {
2495
+ "patterns": [
2496
+ {
2497
+ "match": "(@?[_[:alpha:]][_[:alnum:]]*(?:\\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*)*)\\s*(:)",
2031
2498
  "captures": {
2032
2499
  "1": {
2033
- "name": "keyword.control.default.cs"
2500
+ "patterns": [
2501
+ {
2502
+ "match": "\\@?[_[:alpha:]][_[:alnum:]]*",
2503
+ "name": "variable.other.object.property.cs"
2504
+ },
2505
+ {
2506
+ "include": "#punctuation-accessor"
2507
+ }
2508
+ ]
2034
2509
  },
2035
2510
  "2": {
2036
2511
  "name": "punctuation.separator.colon.cs"
2037
2512
  }
2038
2513
  }
2514
+ },
2515
+ {
2516
+ "include": "#pattern"
2517
+ }
2518
+ ]
2519
+ },
2520
+ "list-pattern": {
2521
+ "begin": "(?=\\[)",
2522
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2523
+ "patterns": [
2524
+ {
2525
+ "begin": "\\[",
2526
+ "beginCaptures": {
2527
+ "0": {
2528
+ "name": "punctuation.squarebracket.open.cs"
2529
+ }
2530
+ },
2531
+ "end": "\\]",
2532
+ "endCaptures": {
2533
+ "0": {
2534
+ "name": "punctuation.squarebracket.close.cs"
2535
+ }
2536
+ },
2537
+ "patterns": [
2538
+ {
2539
+ "include": "#pattern"
2540
+ },
2541
+ {
2542
+ "include": "#punctuation-comma"
2543
+ }
2544
+ ]
2545
+ },
2546
+ {
2547
+ "begin": "(?<=\\])",
2548
+ "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)",
2549
+ "patterns": [
2550
+ {
2551
+ "include": "#intrusive"
2552
+ },
2553
+ {
2554
+ "include": "#simple-designation-pattern"
2555
+ }
2556
+ ]
2039
2557
  }
2040
2558
  ]
2041
2559
  },
2560
+ "slice-pattern": {
2561
+ "match": "\\.\\.",
2562
+ "name": "keyword.operator.range.cs"
2563
+ },
2042
2564
  "do-statement": {
2043
2565
  "begin": "(?<!\\.)\\b(do)\\b",
2044
2566
  "beginCaptures": {
@@ -2087,13 +2609,13 @@
2087
2609
  ]
2088
2610
  },
2089
2611
  "for-statement": {
2090
- "begin": "(?<!\\.)\\b(for)\\b\\s*(?=\\()",
2612
+ "begin": "\\b(for)\\b",
2091
2613
  "beginCaptures": {
2092
2614
  "1": {
2093
2615
  "name": "keyword.control.loop.for.cs"
2094
2616
  }
2095
2617
  },
2096
- "end": "(?<=\\})|(?=;)",
2618
+ "end": "(?<=\\))|(?=;|})",
2097
2619
  "patterns": [
2098
2620
  {
2099
2621
  "begin": "\\(",
@@ -2110,33 +2632,51 @@
2110
2632
  },
2111
2633
  "patterns": [
2112
2634
  {
2113
- "include": "#local-variable-declaration"
2114
- },
2115
- {
2116
- "include": "#expression"
2117
- },
2118
- {
2119
- "include": "#punctuation-comma"
2635
+ "begin": "\\G",
2636
+ "end": "(?=;|\\))",
2637
+ "patterns": [
2638
+ {
2639
+ "include": "#intrusive"
2640
+ },
2641
+ {
2642
+ "include": "#local-variable-declaration"
2643
+ }
2644
+ ]
2120
2645
  },
2121
2646
  {
2122
- "include": "#punctuation-semicolon"
2647
+ "begin": "(?=;)",
2648
+ "end": "(?=\\))",
2649
+ "patterns": [
2650
+ {
2651
+ "include": "#intrusive"
2652
+ },
2653
+ {
2654
+ "include": "#expression"
2655
+ },
2656
+ {
2657
+ "include": "#punctuation-comma"
2658
+ },
2659
+ {
2660
+ "include": "#punctuation-semicolon"
2661
+ }
2662
+ ]
2123
2663
  }
2124
2664
  ]
2125
- },
2126
- {
2127
- "include": "#statement"
2128
2665
  }
2129
2666
  ]
2130
2667
  },
2131
2668
  "foreach-statement": {
2132
- "begin": "(?<!\\.)\\b(foreach)\\b\\s*(?=\\()",
2669
+ "begin": "\\b(foreach)\\b",
2133
2670
  "beginCaptures": {
2134
2671
  "1": {
2135
2672
  "name": "keyword.control.loop.foreach.cs"
2136
2673
  }
2137
2674
  },
2138
- "end": "(?<=\\})|(?=;)",
2675
+ "end": "(?<=\\))|(?=;|})",
2139
2676
  "patterns": [
2677
+ {
2678
+ "include": "#intrusive"
2679
+ },
2140
2680
  {
2141
2681
  "begin": "\\(",
2142
2682
  "beginCaptures": {
@@ -2151,11 +2691,14 @@
2151
2691
  }
2152
2692
  },
2153
2693
  "patterns": [
2694
+ {
2695
+ "include": "#intrusive"
2696
+ },
2154
2697
  {
2155
2698
  "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* # 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",
2156
2699
  "captures": {
2157
2700
  "1": {
2158
- "name": "keyword.other.var.cs"
2701
+ "name": "storage.type.var.cs"
2159
2702
  },
2160
2703
  "2": {
2161
2704
  "patterns": [
@@ -2176,7 +2719,7 @@
2176
2719
  "match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s+\n\\b(in)\\b",
2177
2720
  "captures": {
2178
2721
  "1": {
2179
- "name": "keyword.other.var.cs"
2722
+ "name": "storage.type.var.cs"
2180
2723
  },
2181
2724
  "2": {
2182
2725
  "patterns": [
@@ -2194,9 +2737,6 @@
2194
2737
  "include": "#expression"
2195
2738
  }
2196
2739
  ]
2197
- },
2198
- {
2199
- "include": "#statement"
2200
2740
  }
2201
2741
  ]
2202
2742
  },
@@ -2217,7 +2757,7 @@
2217
2757
  "begin": "(?<!\\.)\\b(try)\\b",
2218
2758
  "beginCaptures": {
2219
2759
  "1": {
2220
- "name": "keyword.control.try.cs"
2760
+ "name": "keyword.control.exception.try.cs"
2221
2761
  }
2222
2762
  },
2223
2763
  "end": "(?<=\\})",
@@ -2234,7 +2774,7 @@
2234
2774
  "begin": "(?<!\\.)\\b(finally)\\b",
2235
2775
  "beginCaptures": {
2236
2776
  "1": {
2237
- "name": "keyword.control.try.finally.cs"
2777
+ "name": "keyword.control.exception.finally.cs"
2238
2778
  }
2239
2779
  },
2240
2780
  "end": "(?<=\\})",
@@ -2251,7 +2791,7 @@
2251
2791
  "begin": "(?<!\\.)\\b(catch)\\b",
2252
2792
  "beginCaptures": {
2253
2793
  "1": {
2254
- "name": "keyword.control.try.catch.cs"
2794
+ "name": "keyword.control.exception.catch.cs"
2255
2795
  }
2256
2796
  },
2257
2797
  "end": "(?<=\\})",
@@ -2302,7 +2842,7 @@
2302
2842
  "begin": "(?<!\\.)\\b(when)\\b\\s*(\\()",
2303
2843
  "beginCaptures": {
2304
2844
  "1": {
2305
- "name": "keyword.control.try.when.cs"
2845
+ "name": "keyword.control.exception.when.cs"
2306
2846
  },
2307
2847
  "2": {
2308
2848
  "name": "punctuation.parenthesis.open.cs"
@@ -2323,35 +2863,71 @@
2323
2863
  }
2324
2864
  ]
2325
2865
  },
2326
- "checked-unchecked-statement": {
2327
- "begin": "(?<!\\.)\\b(?:(checked)|(unchecked))\\b\\s*(?!\\()",
2866
+ "context-control-statement": {
2867
+ "match": "\\b(checked|unchecked|unsafe)\\b(?!\\s*[@_[:alpha:](])",
2868
+ "name": "keyword.control.context.$1.cs"
2869
+ },
2870
+ "context-control-paren-statement": {
2871
+ "patterns": [
2872
+ {
2873
+ "include": "#fixed-statement"
2874
+ },
2875
+ {
2876
+ "include": "#lock-statement"
2877
+ },
2878
+ {
2879
+ "include": "#using-statement"
2880
+ }
2881
+ ]
2882
+ },
2883
+ "fixed-statement": {
2884
+ "begin": "\\b(fixed)\\b",
2328
2885
  "beginCaptures": {
2329
2886
  "1": {
2330
- "name": "keyword.other.checked.cs"
2331
- },
2332
- "2": {
2333
- "name": "keyword.other.unchecked.cs"
2887
+ "name": "keyword.control.context.fixed.cs"
2334
2888
  }
2335
2889
  },
2336
- "end": "(?<=\\})",
2890
+ "end": "(?<=\\))|(?=;|})",
2337
2891
  "patterns": [
2338
2892
  {
2339
- "include": "#block"
2893
+ "include": "#intrusive"
2340
2894
  },
2341
2895
  {
2342
- "include": "#comment"
2896
+ "begin": "\\(",
2897
+ "beginCaptures": {
2898
+ "0": {
2899
+ "name": "punctuation.parenthesis.open.cs"
2900
+ }
2901
+ },
2902
+ "end": "\\)",
2903
+ "endCaptures": {
2904
+ "0": {
2905
+ "name": "punctuation.parenthesis.close.cs"
2906
+ }
2907
+ },
2908
+ "patterns": [
2909
+ {
2910
+ "include": "#intrusive"
2911
+ },
2912
+ {
2913
+ "include": "#local-variable-declaration"
2914
+ }
2915
+ ]
2343
2916
  }
2344
2917
  ]
2345
2918
  },
2346
2919
  "lock-statement": {
2347
- "begin": "(?<!\\.)\\b(lock)\\b\\s*(?=\\()",
2920
+ "begin": "\\b(lock)\\b",
2348
2921
  "beginCaptures": {
2349
2922
  "1": {
2350
- "name": "keyword.other.lock.cs"
2923
+ "name": "keyword.control.context.lock.cs"
2351
2924
  }
2352
2925
  },
2353
- "end": "(?<=\\})|(?=;)",
2926
+ "end": "(?<=\\))|(?=;|})",
2354
2927
  "patterns": [
2928
+ {
2929
+ "include": "#intrusive"
2930
+ },
2355
2931
  {
2356
2932
  "begin": "\\(",
2357
2933
  "beginCaptures": {
@@ -2366,25 +2942,28 @@
2366
2942
  }
2367
2943
  },
2368
2944
  "patterns": [
2945
+ {
2946
+ "include": "#intrusive"
2947
+ },
2369
2948
  {
2370
2949
  "include": "#expression"
2371
2950
  }
2372
2951
  ]
2373
- },
2374
- {
2375
- "include": "#statement"
2376
2952
  }
2377
2953
  ]
2378
2954
  },
2379
2955
  "using-statement": {
2380
- "begin": "(?<!\\.)\\b(using)\\b\\s*(?=\\()",
2956
+ "begin": "\\b(using)\\b",
2381
2957
  "beginCaptures": {
2382
2958
  "1": {
2383
- "name": "keyword.other.using.cs"
2959
+ "name": "keyword.control.context.using.cs"
2384
2960
  }
2385
2961
  },
2386
- "end": "(?=\\;|})",
2962
+ "end": "(?<=\\))|(?=;|})",
2387
2963
  "patterns": [
2964
+ {
2965
+ "include": "#intrusive"
2966
+ },
2388
2967
  {
2389
2968
  "begin": "\\(",
2390
2969
  "beginCaptures": {
@@ -2399,6 +2978,12 @@
2399
2978
  }
2400
2979
  },
2401
2980
  "patterns": [
2981
+ {
2982
+ "include": "#intrusive"
2983
+ },
2984
+ {
2985
+ "include": "#await-expression"
2986
+ },
2402
2987
  {
2403
2988
  "include": "#local-variable-declaration"
2404
2989
  },
@@ -2408,7 +2993,7 @@
2408
2993
  ]
2409
2994
  },
2410
2995
  {
2411
- "include": "#statement"
2996
+ "include": "#local-variable-declaration"
2412
2997
  }
2413
2998
  ]
2414
2999
  },
@@ -2440,32 +3025,29 @@
2440
3025
  ]
2441
3026
  },
2442
3027
  "local-variable-declaration": {
2443
- "begin": "(?x)\n(?:\n (?:(\\busing)\\s+)?\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 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(?=,|;|=|\\))",
3028
+ "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(?=,|;|=|\\))",
2444
3029
  "beginCaptures": {
2445
3030
  "1": {
2446
- "name": "keyword.other.using.cs"
3031
+ "name": "storage.modifier.ref.cs"
2447
3032
  },
2448
3033
  "2": {
2449
- "name": "storage.modifier.cs"
3034
+ "name": "storage.modifier.readonly.cs"
2450
3035
  },
2451
3036
  "3": {
2452
- "name": "storage.modifier.cs"
3037
+ "name": "storage.type.var.cs"
2453
3038
  },
2454
3039
  "4": {
2455
- "name": "keyword.other.var.cs"
2456
- },
2457
- "5": {
2458
3040
  "patterns": [
2459
3041
  {
2460
3042
  "include": "#type"
2461
3043
  }
2462
3044
  ]
2463
3045
  },
2464
- "10": {
3046
+ "9": {
2465
3047
  "name": "entity.name.variable.local.cs"
2466
3048
  }
2467
3049
  },
2468
- "end": "(?=;|\\))",
3050
+ "end": "(?=[;)}])",
2469
3051
  "patterns": [
2470
3052
  {
2471
3053
  "name": "entity.name.variable.local.cs",
@@ -2486,7 +3068,7 @@
2486
3068
  "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(?=,|;|=)",
2487
3069
  "beginCaptures": {
2488
3070
  "1": {
2489
- "name": "storage.modifier.cs"
3071
+ "name": "storage.modifier.const.cs"
2490
3072
  },
2491
3073
  "2": {
2492
3074
  "patterns": [
@@ -2517,9 +3099,49 @@
2517
3099
  ]
2518
3100
  },
2519
3101
  "local-function-declaration": {
3102
+ "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(?=\\()",
3103
+ "beginCaptures": {
3104
+ "1": {
3105
+ "patterns": [
3106
+ {
3107
+ "include": "#storage-modifier"
3108
+ }
3109
+ ]
3110
+ },
3111
+ "2": {
3112
+ "patterns": [
3113
+ {
3114
+ "include": "#type"
3115
+ }
3116
+ ]
3117
+ },
3118
+ "7": {
3119
+ "name": "entity.name.function.cs"
3120
+ },
3121
+ "8": {
3122
+ "patterns": [
3123
+ {
3124
+ "include": "#type-parameter-list"
3125
+ }
3126
+ ]
3127
+ }
3128
+ },
3129
+ "end": "(?<=\\})|(?=;)",
2520
3130
  "patterns": [
2521
3131
  {
2522
- "include": "#method-declaration"
3132
+ "include": "#comment"
3133
+ },
3134
+ {
3135
+ "include": "#parenthesized-parameter-list"
3136
+ },
3137
+ {
3138
+ "include": "#generic-constraints"
3139
+ },
3140
+ {
3141
+ "include": "#expression-body"
3142
+ },
3143
+ {
3144
+ "include": "#block"
2523
3145
  }
2524
3146
  ]
2525
3147
  },
@@ -2527,7 +3149,7 @@
2527
3149
  "begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?<tuple>\\((?:[^\\(\\)]|\\g<tuple>)+\\))\\s*\n(?=;|=|\\))",
2528
3150
  "beginCaptures": {
2529
3151
  "1": {
2530
- "name": "keyword.other.var.cs"
3152
+ "name": "storage.type.var.cs"
2531
3153
  },
2532
3154
  "2": {
2533
3155
  "patterns": [
@@ -2635,7 +3257,7 @@
2635
3257
  "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(?=[,)\\]])",
2636
3258
  "captures": {
2637
3259
  "1": {
2638
- "name": "keyword.other.var.cs"
3260
+ "name": "storage.type.var.cs"
2639
3261
  },
2640
3262
  "2": {
2641
3263
  "patterns": [
@@ -2653,7 +3275,7 @@
2653
3275
  "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(?=[,)])",
2654
3276
  "captures": {
2655
3277
  "1": {
2656
- "name": "keyword.other.var.cs"
3278
+ "name": "storage.type.var.cs"
2657
3279
  },
2658
3280
  "2": {
2659
3281
  "patterns": [
@@ -2667,16 +3289,13 @@
2667
3289
  }
2668
3290
  }
2669
3291
  },
2670
- "checked-unchecked-expression": {
2671
- "begin": "(?<!\\.)\\b(?:(checked)|(unchecked))\\b\\s*(\\()",
3292
+ "expression-operator-expression": {
3293
+ "begin": "\\b(checked|unchecked|nameof)\\s*(\\()",
2672
3294
  "beginCaptures": {
2673
3295
  "1": {
2674
- "name": "keyword.other.checked.cs"
3296
+ "name": "keyword.operator.expression.$1.cs"
2675
3297
  },
2676
3298
  "2": {
2677
- "name": "keyword.other.unchecked.cs"
2678
- },
2679
- "3": {
2680
3299
  "name": "punctuation.parenthesis.open.cs"
2681
3300
  }
2682
3301
  },
@@ -2692,16 +3311,13 @@
2692
3311
  }
2693
3312
  ]
2694
3313
  },
2695
- "typeof-or-default-expression": {
2696
- "begin": "(?<!\\.)\\b(?:(typeof)|(default))\\b\\s*(\\()",
3314
+ "type-operator-expression": {
3315
+ "begin": "\\b(default|sizeof|typeof)\\s*(\\()",
2697
3316
  "beginCaptures": {
2698
3317
  "1": {
2699
- "name": "keyword.other.typeof.cs"
3318
+ "name": "keyword.operator.expression.$1.cs"
2700
3319
  },
2701
3320
  "2": {
2702
- "name": "keyword.other.default.cs"
2703
- },
2704
- "3": {
2705
3321
  "name": "punctuation.parenthesis.open.cs"
2706
3322
  }
2707
3323
  },
@@ -2717,38 +3333,16 @@
2717
3333
  }
2718
3334
  ]
2719
3335
  },
2720
- "nameof-expression": {
2721
- "begin": "(?<!\\.)\\b(nameof)\\b\\s*(\\()",
2722
- "beginCaptures": {
2723
- "1": {
2724
- "name": "keyword.other.nameof.cs"
2725
- },
2726
- "2": {
2727
- "name": "punctuation.parenthesis.open.cs"
2728
- }
2729
- },
2730
- "end": "\\)",
2731
- "endCaptures": {
2732
- "0": {
2733
- "name": "punctuation.parenthesis.close.cs"
2734
- }
2735
- },
2736
- "patterns": [
2737
- {
2738
- "include": "#expression"
2739
- }
2740
- ]
2741
- },
2742
3336
  "default-literal-expression": {
2743
- "match": "(?<!\\.)\\b(default)\\b",
3337
+ "match": "\\b(default)\\b",
2744
3338
  "captures": {
2745
3339
  "1": {
2746
- "name": "keyword.other.default.cs"
3340
+ "name": "keyword.operator.expression.default.cs"
2747
3341
  }
2748
3342
  }
2749
3343
  },
2750
3344
  "throw-expression": {
2751
- "match": "(?<!\\.)\\b(throw)\\b",
3345
+ "match": "\\b(throw)\\b",
2752
3346
  "captures": {
2753
3347
  "1": {
2754
3348
  "name": "keyword.control.flow.throw.cs"
@@ -3383,7 +3977,28 @@
3383
3977
  }
3384
3978
  }
3385
3979
  },
3386
- "expression-operators": {
3980
+ "assignment-expression": {
3981
+ "begin": "(?:\\*|/|%|\\+|-|\\?\\?|\\&|\\^|<<|>>>?|\\|)?=(?!=|>)",
3982
+ "beginCaptures": {
3983
+ "0": {
3984
+ "patterns": [
3985
+ {
3986
+ "include": "#assignment-operators"
3987
+ }
3988
+ ]
3989
+ }
3990
+ },
3991
+ "end": "(?=[,\\)\\];}])",
3992
+ "patterns": [
3993
+ {
3994
+ "include": "#ref-modifier"
3995
+ },
3996
+ {
3997
+ "include": "#expression"
3998
+ }
3999
+ ]
4000
+ },
4001
+ "assignment-operators": {
3387
4002
  "patterns": [
3388
4003
  {
3389
4004
  "name": "keyword.operator.assignment.compound.cs",
@@ -3391,11 +4006,19 @@
3391
4006
  },
3392
4007
  {
3393
4008
  "name": "keyword.operator.assignment.compound.bitwise.cs",
3394
- "match": "\\&=|\\^=|<<=|>>=|\\|="
4009
+ "match": "\\&=|\\^=|<<=|>>>?=|\\|="
3395
4010
  },
4011
+ {
4012
+ "name": "keyword.operator.assignment.cs",
4013
+ "match": "\\="
4014
+ }
4015
+ ]
4016
+ },
4017
+ "expression-operators": {
4018
+ "patterns": [
3396
4019
  {
3397
4020
  "name": "keyword.operator.bitwise.shift.cs",
3398
- "match": "<<|>>"
4021
+ "match": "<<|>>>?"
3399
4022
  },
3400
4023
  {
3401
4024
  "name": "keyword.operator.comparison.cs",
@@ -3413,10 +4036,6 @@
3413
4036
  "name": "keyword.operator.bitwise.cs",
3414
4037
  "match": "\\&|~|\\^|\\|"
3415
4038
  },
3416
- {
3417
- "name": "keyword.operator.assignment.cs",
3418
- "match": "\\="
3419
- },
3420
4039
  {
3421
4040
  "name": "keyword.operator.decrement.cs",
3422
4041
  "match": "--"
@@ -3427,56 +4046,50 @@
3427
4046
  },
3428
4047
  {
3429
4048
  "name": "keyword.operator.arithmetic.cs",
3430
- "match": "%|\\*|/|-|\\+"
4049
+ "match": "\\+|-(?!>)|\\*|/|%"
3431
4050
  },
3432
4051
  {
3433
4052
  "name": "keyword.operator.null-coalescing.cs",
3434
4053
  "match": "\\?\\?"
4054
+ },
4055
+ {
4056
+ "name": "keyword.operator.range.cs",
4057
+ "match": "\\.\\."
3435
4058
  }
3436
4059
  ]
3437
4060
  },
3438
- "switch-literal": {
3439
- "name": "constant.language.null.cs",
3440
- "match": "(?<!\\.)\\bnull\\b",
4061
+ "with-expression": {
4062
+ "begin": "(?<!\\.)\\b(with)\\b\\s*(?=\\{|//|/\\*|$)",
3441
4063
  "beginCaptures": {
3442
4064
  "1": {
3443
- "name": "constant.language.null.cs"
4065
+ "name": "keyword.operator.expression.with.cs"
3444
4066
  }
3445
4067
  },
4068
+ "end": "(?<=\\})",
3446
4069
  "patterns": [
3447
4070
  {
3448
4071
  "include": "#comment"
3449
4072
  },
3450
4073
  {
3451
- "include": "#punctuation-comma"
3452
- },
3453
- {
3454
- "include": "#expression-body"
4074
+ "include": "#initializer-expression"
3455
4075
  }
3456
4076
  ]
3457
4077
  },
3458
4078
  "conditional-operator": {
3459
- "begin": "\\?(?!\\s*[?.\\[]|\\s*$)",
3460
- "beginCaptures": {
3461
- "0": {
3462
- "name": "keyword.operator.conditional.question-mark.cs"
3463
- }
3464
- },
3465
- "end": ":",
3466
- "endCaptures": {
3467
- "0": {
3468
- "name": "keyword.operator.conditional.colon.cs"
3469
- }
3470
- },
3471
4079
  "patterns": [
3472
4080
  {
3473
- "include": "#expression"
4081
+ "name": "keyword.operator.conditional.question-mark.cs",
4082
+ "match": "\\?(?!\\?|\\s*[.\\[])"
4083
+ },
4084
+ {
4085
+ "name": "keyword.operator.conditional.colon.cs",
4086
+ "match": ":"
3474
4087
  }
3475
4088
  ]
3476
4089
  },
3477
4090
  "await-expression": {
3478
- "name": "keyword.other.await.cs",
3479
- "match": "(?!\\.)\\b(await)\\b"
4091
+ "name": "keyword.operator.expression.await.cs",
4092
+ "match": "(?<!\\.\\s*)\\b(await)\\b"
3480
4093
  },
3481
4094
  "parenthesized-expression": {
3482
4095
  "begin": "\\(",
@@ -3542,25 +4155,10 @@
3542
4155
  }
3543
4156
  },
3544
4157
  "as-expression": {
3545
- "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*\\?\\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)?",
3546
- "captures": {
3547
- "1": {
3548
- "name": "keyword.other.as.cs"
3549
- },
3550
- "2": {
3551
- "patterns": [
3552
- {
3553
- "include": "#type"
3554
- }
3555
- ]
3556
- }
3557
- }
3558
- },
3559
- "is-expression": {
3560
- "match": "(?x)\n(?<!\\.)\\b(is)\\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)?",
4158
+ "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)?",
3561
4159
  "captures": {
3562
4160
  "1": {
3563
- "name": "keyword.other.is.cs"
4161
+ "name": "keyword.operator.expression.as.cs"
3564
4162
  },
3565
4163
  "2": {
3566
4164
  "patterns": [
@@ -3571,19 +4169,20 @@
3571
4169
  }
3572
4170
  }
3573
4171
  },
3574
- "this-or-base-expression": {
3575
- "match": "\\b(?:(base)|(this))\\b",
3576
- "captures": {
3577
- "1": {
3578
- "name": "keyword.other.base.cs"
4172
+ "language-variable": {
4173
+ "patterns": [
4174
+ {
4175
+ "name": "variable.language.$1.cs",
4176
+ "match": "\\b(base|this)\\b"
3579
4177
  },
3580
- "2": {
3581
- "name": "keyword.other.this.cs"
4178
+ {
4179
+ "name": "variable.other.$1.cs",
4180
+ "match": "\\b(value)\\b"
3582
4181
  }
3583
- }
4182
+ ]
3584
4183
  },
3585
4184
  "invocation-expression": {
3586
- "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?<type_args>\\s*<([^<>]|\\g<type_args>)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list",
4185
+ "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 <\\g<type_args>+>|\n \\(\\g<type_args>+\\)\n )+\n >\\s*\n)? # type arguments\n(?=\\() # open paren of argument list",
3587
4186
  "beginCaptures": {
3588
4187
  "1": {
3589
4188
  "name": "keyword.operator.null-conditional.cs"
@@ -3592,9 +4191,12 @@
3592
4191
  "name": "punctuation.accessor.cs"
3593
4192
  },
3594
4193
  "3": {
3595
- "name": "entity.name.function.cs"
4194
+ "name": "punctuation.accessor.pointer.cs"
3596
4195
  },
3597
4196
  "4": {
4197
+ "name": "entity.name.function.cs"
4198
+ },
4199
+ "5": {
3598
4200
  "patterns": [
3599
4201
  {
3600
4202
  "include": "#type-arguments"
@@ -3610,7 +4212,7 @@
3610
4212
  ]
3611
4213
  },
3612
4214
  "element-access-expression": {
3613
- "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list",
4215
+ "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",
3614
4216
  "beginCaptures": {
3615
4217
  "1": {
3616
4218
  "name": "keyword.operator.null-conditional.cs"
@@ -3619,9 +4221,12 @@
3619
4221
  "name": "punctuation.accessor.cs"
3620
4222
  },
3621
4223
  "3": {
3622
- "name": "variable.other.object.property.cs"
4224
+ "name": "punctuation.accessor.pointer.cs"
3623
4225
  },
3624
4226
  "4": {
4227
+ "name": "variable.other.object.property.cs"
4228
+ },
4229
+ "5": {
3625
4230
  "name": "keyword.operator.null-conditional.cs"
3626
4231
  }
3627
4232
  },
@@ -3635,7 +4240,7 @@
3635
4240
  "member-access-expression": {
3636
4241
  "patterns": [
3637
4242
  {
3638
- "match": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(\\.)\\s* # preceding dot\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[",
4243
+ "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 ?[",
3639
4244
  "captures": {
3640
4245
  "1": {
3641
4246
  "name": "keyword.operator.null-conditional.cs"
@@ -3644,6 +4249,9 @@
3644
4249
  "name": "punctuation.accessor.cs"
3645
4250
  },
3646
4251
  "3": {
4252
+ "name": "punctuation.accessor.pointer.cs"
4253
+ },
4254
+ "4": {
3647
4255
  "name": "variable.other.object.property.cs"
3648
4256
  }
3649
4257
  }
@@ -3667,7 +4275,7 @@
3667
4275
  }
3668
4276
  },
3669
4277
  {
3670
- "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
4278
+ "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n \\s*(?:(?:\\?\\s*)?\\.|->)\n \\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
3671
4279
  "captures": {
3672
4280
  "1": {
3673
4281
  "name": "variable.other.object.cs"
@@ -3690,7 +4298,7 @@
3690
4298
  "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(?=\\()",
3691
4299
  "beginCaptures": {
3692
4300
  "1": {
3693
- "name": "keyword.other.new.cs"
4301
+ "name": "keyword.operator.expression.new.cs"
3694
4302
  },
3695
4303
  "2": {
3696
4304
  "patterns": [
@@ -3708,10 +4316,10 @@
3708
4316
  ]
3709
4317
  },
3710
4318
  "object-creation-expression-with-no-parameters": {
3711
- "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(?=\\{|$)",
4319
+ "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(?=\\{|//|/\\*|$)",
3712
4320
  "captures": {
3713
4321
  "1": {
3714
- "name": "keyword.other.new.cs"
4322
+ "name": "keyword.operator.expression.new.cs"
3715
4323
  },
3716
4324
  "2": {
3717
4325
  "patterns": [
@@ -3726,7 +4334,7 @@
3726
4334
  "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(?=\\[)",
3727
4335
  "beginCaptures": {
3728
4336
  "1": {
3729
- "name": "keyword.other.new.cs"
4337
+ "name": "keyword.operator.expression.$1.cs"
3730
4338
  },
3731
4339
  "2": {
3732
4340
  "patterns": [
@@ -3744,14 +4352,17 @@
3744
4352
  ]
3745
4353
  },
3746
4354
  "anonymous-object-creation-expression": {
3747
- "begin": "\\b(new)\\b\\s*(?=\\{|$)",
4355
+ "begin": "\\b(new)\\b\\s*(?=\\{|//|/\\*|$)",
3748
4356
  "beginCaptures": {
3749
4357
  "1": {
3750
- "name": "keyword.other.new.cs"
4358
+ "name": "keyword.operator.expression.new.cs"
3751
4359
  }
3752
4360
  },
3753
4361
  "end": "(?<=\\})",
3754
4362
  "patterns": [
4363
+ {
4364
+ "include": "#comment"
4365
+ },
3755
4366
  {
3756
4367
  "include": "#initializer-expression"
3757
4368
  }
@@ -3829,7 +4440,7 @@
3829
4440
  "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>)",
3830
4441
  "captures": {
3831
4442
  "1": {
3832
- "name": "storage.modifier.cs"
4443
+ "name": "storage.modifier.$1.cs"
3833
4444
  },
3834
4445
  "2": {
3835
4446
  "patterns": [
@@ -3913,11 +4524,25 @@
3913
4524
  "argument": {
3914
4525
  "patterns": [
3915
4526
  {
3916
- "name": "storage.modifier.cs",
3917
- "match": "\\b(ref|out|in)\\b"
4527
+ "name": "storage.modifier.$1.cs",
4528
+ "match": "\\b(ref|in)\\b"
3918
4529
  },
3919
4530
  {
3920
- "include": "#declaration-expression-local"
4531
+ "begin": "\\b(out)\\b",
4532
+ "beginCaptures": {
4533
+ "1": {
4534
+ "name": "storage.modifier.out.cs"
4535
+ }
4536
+ },
4537
+ "end": "(?=,|\\)|\\])",
4538
+ "patterns": [
4539
+ {
4540
+ "include": "#declaration-expression-local"
4541
+ },
4542
+ {
4543
+ "include": "#expression"
4544
+ }
4545
+ ]
3921
4546
  },
3922
4547
  {
3923
4548
  "include": "#expression"
@@ -3928,7 +4553,7 @@
3928
4553
  "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*",
3929
4554
  "beginCaptures": {
3930
4555
  "1": {
3931
- "name": "keyword.query.from.cs"
4556
+ "name": "keyword.operator.expression.query.from.cs"
3932
4557
  },
3933
4558
  "2": {
3934
4559
  "patterns": [
@@ -3941,7 +4566,7 @@
3941
4566
  "name": "entity.name.variable.range-variable.cs"
3942
4567
  },
3943
4568
  "8": {
3944
- "name": "keyword.query.in.cs"
4569
+ "name": "keyword.operator.expression.query.in.cs"
3945
4570
  }
3946
4571
  },
3947
4572
  "end": "(?=;|\\))",
@@ -3980,7 +4605,7 @@
3980
4605
  "begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*",
3981
4606
  "beginCaptures": {
3982
4607
  "1": {
3983
- "name": "keyword.query.let.cs"
4608
+ "name": "keyword.operator.expression.query.let.cs"
3984
4609
  },
3985
4610
  "2": {
3986
4611
  "name": "entity.name.variable.range-variable.cs"
@@ -4003,7 +4628,7 @@
4003
4628
  "begin": "(?x)\n\\b(where)\\b\\s*",
4004
4629
  "beginCaptures": {
4005
4630
  "1": {
4006
- "name": "keyword.query.where.cs"
4631
+ "name": "keyword.operator.expression.query.where.cs"
4007
4632
  }
4008
4633
  },
4009
4634
  "end": "(?=;|\\))",
@@ -4020,7 +4645,7 @@
4020
4645
  "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*",
4021
4646
  "beginCaptures": {
4022
4647
  "1": {
4023
- "name": "keyword.query.join.cs"
4648
+ "name": "keyword.operator.expression.query.join.cs"
4024
4649
  },
4025
4650
  "2": {
4026
4651
  "patterns": [
@@ -4033,7 +4658,7 @@
4033
4658
  "name": "entity.name.variable.range-variable.cs"
4034
4659
  },
4035
4660
  "8": {
4036
- "name": "keyword.query.in.cs"
4661
+ "name": "keyword.operator.expression.query.in.cs"
4037
4662
  }
4038
4663
  },
4039
4664
  "end": "(?=;|\\))",
@@ -4059,7 +4684,7 @@
4059
4684
  "match": "\\b(on)\\b\\s*",
4060
4685
  "captures": {
4061
4686
  "1": {
4062
- "name": "keyword.query.on.cs"
4687
+ "name": "keyword.operator.expression.query.on.cs"
4063
4688
  }
4064
4689
  }
4065
4690
  },
@@ -4067,7 +4692,7 @@
4067
4692
  "match": "\\b(equals)\\b\\s*",
4068
4693
  "captures": {
4069
4694
  "1": {
4070
- "name": "keyword.query.equals.cs"
4695
+ "name": "keyword.operator.expression.query.equals.cs"
4071
4696
  }
4072
4697
  }
4073
4698
  },
@@ -4075,7 +4700,7 @@
4075
4700
  "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
4076
4701
  "captures": {
4077
4702
  "1": {
4078
- "name": "keyword.query.into.cs"
4703
+ "name": "keyword.operator.expression.query.into.cs"
4079
4704
  },
4080
4705
  "2": {
4081
4706
  "name": "entity.name.variable.range-variable.cs"
@@ -4086,7 +4711,7 @@
4086
4711
  "begin": "\\b(orderby)\\b\\s*",
4087
4712
  "beginCaptures": {
4088
4713
  "1": {
4089
- "name": "keyword.query.orderby.cs"
4714
+ "name": "keyword.operator.expression.query.orderby.cs"
4090
4715
  }
4091
4716
  },
4092
4717
  "end": "(?=;|\\))",
@@ -4106,13 +4731,10 @@
4106
4731
  ]
4107
4732
  },
4108
4733
  "ordering-direction": {
4109
- "match": "\\b(?:(ascending)|(descending))\\b",
4734
+ "match": "\\b(ascending|descending)\\b",
4110
4735
  "captures": {
4111
4736
  "1": {
4112
- "name": "keyword.query.ascending.cs"
4113
- },
4114
- "2": {
4115
- "name": "keyword.query.descending.cs"
4737
+ "name": "keyword.operator.expression.query.$1.cs"
4116
4738
  }
4117
4739
  }
4118
4740
  },
@@ -4120,7 +4742,7 @@
4120
4742
  "begin": "\\b(select)\\b\\s*",
4121
4743
  "beginCaptures": {
4122
4744
  "1": {
4123
- "name": "keyword.query.select.cs"
4745
+ "name": "keyword.operator.expression.query.select.cs"
4124
4746
  }
4125
4747
  },
4126
4748
  "end": "(?=;|\\))",
@@ -4137,7 +4759,7 @@
4137
4759
  "begin": "\\b(group)\\b\\s*",
4138
4760
  "beginCaptures": {
4139
4761
  "1": {
4140
- "name": "keyword.query.group.cs"
4762
+ "name": "keyword.operator.expression.query.group.cs"
4141
4763
  }
4142
4764
  },
4143
4765
  "end": "(?=;|\\))",
@@ -4160,7 +4782,7 @@
4160
4782
  "match": "\\b(by)\\b\\s*",
4161
4783
  "captures": {
4162
4784
  "1": {
4163
- "name": "keyword.query.by.cs"
4785
+ "name": "keyword.operator.expression.query.by.cs"
4164
4786
  }
4165
4787
  }
4166
4788
  },
@@ -4168,7 +4790,7 @@
4168
4790
  "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
4169
4791
  "captures": {
4170
4792
  "1": {
4171
- "name": "keyword.query.into.cs"
4793
+ "name": "keyword.operator.expression.query.into.cs"
4172
4794
  },
4173
4795
  "2": {
4174
4796
  "name": "entity.name.variable.range-variable.cs"
@@ -4178,10 +4800,15 @@
4178
4800
  "anonymous-method-expression": {
4179
4801
  "patterns": [
4180
4802
  {
4181
- "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)",
4803
+ "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)",
4182
4804
  "beginCaptures": {
4183
4805
  "1": {
4184
- "name": "storage.modifier.cs"
4806
+ "patterns": [
4807
+ {
4808
+ "match": "async|static",
4809
+ "name": "storage.modifier.$0.cs"
4810
+ }
4811
+ ]
4185
4812
  },
4186
4813
  "2": {
4187
4814
  "name": "entity.name.variable.parameter.cs"
@@ -4204,10 +4831,15 @@
4204
4831
  ]
4205
4832
  },
4206
4833
  {
4207
- "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(\\(.*?\\))\\s*\n(=>)",
4834
+ "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?<tuple>\n \\(\n (?:[^()]|\\g<tuple>)*\n \\)\n)\\s*\n(=>)",
4208
4835
  "beginCaptures": {
4209
4836
  "1": {
4210
- "name": "storage.modifier.cs"
4837
+ "patterns": [
4838
+ {
4839
+ "match": "async|static",
4840
+ "name": "storage.modifier.$0.cs"
4841
+ }
4842
+ ]
4211
4843
  },
4212
4844
  "2": {
4213
4845
  "patterns": [
@@ -4234,13 +4866,18 @@
4234
4866
  ]
4235
4867
  },
4236
4868
  {
4237
- "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(?:\\b(delegate)\\b\\s*)",
4869
+ "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\\b(delegate)\\b\\s*)",
4238
4870
  "beginCaptures": {
4239
4871
  "1": {
4240
- "name": "storage.modifier.cs"
4872
+ "patterns": [
4873
+ {
4874
+ "match": "async|static",
4875
+ "name": "storage.modifier.$0.cs"
4876
+ }
4877
+ ]
4241
4878
  },
4242
4879
  "2": {
4243
- "name": "keyword.other.delegate.cs"
4880
+ "name": "storage.type.delegate.cs"
4244
4881
  }
4245
4882
  },
4246
4883
  "end": "(?=\\)|;|}|,)",
@@ -4250,9 +4887,6 @@
4250
4887
  },
4251
4888
  {
4252
4889
  "include": "#block"
4253
- },
4254
- {
4255
- "include": "#expression"
4256
4890
  }
4257
4891
  ]
4258
4892
  }
@@ -4290,7 +4924,7 @@
4290
4924
  "match": "(?x)\n(?:\\b(ref|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>\\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\\s*\n(?=[,)])",
4291
4925
  "captures": {
4292
4926
  "1": {
4293
- "name": "storage.modifier.cs"
4927
+ "name": "storage.modifier.$1.cs"
4294
4928
  },
4295
4929
  "2": {
4296
4930
  "patterns": [
@@ -4305,7 +4939,6 @@
4305
4939
  }
4306
4940
  },
4307
4941
  "type": {
4308
- "name": "meta.type.cs",
4309
4942
  "patterns": [
4310
4943
  {
4311
4944
  "include": "#comment"
@@ -4333,16 +4966,19 @@
4333
4966
  },
4334
4967
  {
4335
4968
  "include": "#type-nullable-suffix"
4969
+ },
4970
+ {
4971
+ "include": "#type-pointer-suffix"
4336
4972
  }
4337
4973
  ]
4338
4974
  },
4339
4975
  "ref-modifier": {
4340
- "name": "storage.modifier.cs",
4341
- "match": "\\b(ref)\\b"
4976
+ "name": "storage.modifier.ref.cs",
4977
+ "match": "\\bref\\b"
4342
4978
  },
4343
4979
  "readonly-modifier": {
4344
- "name": "storage.modifier.cs",
4345
- "match": "\\b(readonly)\\b"
4980
+ "name": "storage.modifier.readonly.cs",
4981
+ "match": "\\breadonly\\b"
4346
4982
  },
4347
4983
  "tuple-type": {
4348
4984
  "begin": "\\(",
@@ -4382,10 +5018,10 @@
4382
5018
  }
4383
5019
  },
4384
5020
  "type-builtin": {
4385
- "match": "\\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|dynamic)\\b",
5021
+ "match": "\\b(bool|s?byte|u?short|n?u?int|u?long|float|double|decimal|char|string|object|void|dynamic)\\b",
4386
5022
  "captures": {
4387
5023
  "1": {
4388
- "name": "keyword.type.cs"
5024
+ "name": "keyword.type.$1.cs"
4389
5025
  }
4390
5026
  }
4391
5027
  },
@@ -4444,9 +5080,6 @@
4444
5080
  }
4445
5081
  },
4446
5082
  "patterns": [
4447
- {
4448
- "include": "#comment"
4449
- },
4450
5083
  {
4451
5084
  "include": "#type"
4452
5085
  },
@@ -4469,6 +5102,9 @@
4469
5102
  }
4470
5103
  },
4471
5104
  "patterns": [
5105
+ {
5106
+ "include": "#intrusive"
5107
+ },
4472
5108
  {
4473
5109
  "include": "#punctuation-comma"
4474
5110
  }
@@ -4476,11 +5112,11 @@
4476
5112
  },
4477
5113
  "type-nullable-suffix": {
4478
5114
  "match": "\\?",
4479
- "captures": {
4480
- "0": {
4481
- "name": "punctuation.separator.question-mark.cs"
4482
- }
4483
- }
5115
+ "name": "punctuation.separator.question-mark.cs"
5116
+ },
5117
+ "type-pointer-suffix": {
5118
+ "match": "\\*",
5119
+ "name": "punctuation.separator.asterisk.cs"
4484
5120
  },
4485
5121
  "operator-assignment": {
4486
5122
  "name": "keyword.operator.assignment.cs",
@@ -4498,6 +5134,16 @@
4498
5134
  "name": "punctuation.accessor.cs",
4499
5135
  "match": "\\."
4500
5136
  },
5137
+ "intrusive": {
5138
+ "patterns": [
5139
+ {
5140
+ "include": "#preprocessor"
5141
+ },
5142
+ {
5143
+ "include": "#comment"
5144
+ }
5145
+ ]
5146
+ },
4501
5147
  "preprocessor": {
4502
5148
  "name": "meta.preprocessor.cs",
4503
5149
  "begin": "^\\s*(\\#)\\s*",
@@ -4803,38 +5449,47 @@
4803
5449
  "comment": {
4804
5450
  "patterns": [
4805
5451
  {
4806
- "name": "comment.block.cs",
4807
- "begin": "/\\*",
4808
- "beginCaptures": {
4809
- "0": {
5452
+ "name": "comment.block.documentation.cs",
5453
+ "begin": "(^\\s+)?(///)(?!/)",
5454
+ "while": "^(\\s*)(///)(?!/)",
5455
+ "captures": {
5456
+ "1": {
5457
+ "name": "punctuation.whitespace.comment.leading.cs"
5458
+ },
5459
+ "2": {
4810
5460
  "name": "punctuation.definition.comment.cs"
4811
5461
  }
4812
5462
  },
4813
- "end": "\\*/",
4814
- "endCaptures": {
4815
- "0": {
4816
- "name": "punctuation.definition.comment.cs"
5463
+ "patterns": [
5464
+ {
5465
+ "include": "#xml-doc-comment"
4817
5466
  }
4818
- }
5467
+ ]
4819
5468
  },
4820
5469
  {
4821
- "begin": "(^\\s+)?(?=//)",
4822
- "beginCaptures": {
5470
+ "name": "comment.block.documentation.cs",
5471
+ "begin": "(^\\s+)?(/\\*\\*)(?!/)",
5472
+ "end": "(^\\s+)?(\\*/)",
5473
+ "captures": {
4823
5474
  "1": {
4824
5475
  "name": "punctuation.whitespace.comment.leading.cs"
5476
+ },
5477
+ "2": {
5478
+ "name": "punctuation.definition.comment.cs"
4825
5479
  }
4826
5480
  },
4827
- "end": "(?=$)",
4828
5481
  "patterns": [
4829
5482
  {
4830
- "name": "comment.block.documentation.cs",
4831
- "begin": "(?<!/)///(?!/)",
4832
- "beginCaptures": {
4833
- "0": {
5483
+ "begin": "\\G(?=(?~\\*/)$)",
5484
+ "while": "^(\\s*+)(\\*(?!/))?(?=(?~\\*/)$)",
5485
+ "whileCaptures": {
5486
+ "1": {
5487
+ "name": "punctuation.whitespace.comment.leading.cs"
5488
+ },
5489
+ "2": {
4834
5490
  "name": "punctuation.definition.comment.cs"
4835
5491
  }
4836
5492
  },
4837
- "end": "(?=$)",
4838
5493
  "patterns": [
4839
5494
  {
4840
5495
  "include": "#xml-doc-comment"
@@ -4842,16 +5497,32 @@
4842
5497
  ]
4843
5498
  },
4844
5499
  {
4845
- "name": "comment.line.double-slash.cs",
4846
- "begin": "(?<!/)//(?:(?!/)|(?=//))",
4847
- "beginCaptures": {
4848
- "0": {
4849
- "name": "punctuation.definition.comment.cs"
4850
- }
4851
- },
4852
- "end": "(?=$)"
5500
+ "include": "#xml-doc-comment"
4853
5501
  }
4854
5502
  ]
5503
+ },
5504
+ {
5505
+ "name": "comment.line.double-slash.cs",
5506
+ "begin": "(^\\s+)?(//).*$",
5507
+ "while": "^(\\s*)(//).*$",
5508
+ "captures": {
5509
+ "1": {
5510
+ "name": "punctuation.whitespace.comment.leading.cs"
5511
+ },
5512
+ "2": {
5513
+ "name": "punctuation.definition.comment.cs"
5514
+ }
5515
+ }
5516
+ },
5517
+ {
5518
+ "name": "comment.block.cs",
5519
+ "begin": "/\\*",
5520
+ "end": "\\*/",
5521
+ "captures": {
5522
+ "0": {
5523
+ "name": "punctuation.definition.comment.cs"
5524
+ }
5525
+ }
4855
5526
  }
4856
5527
  ]
4857
5528
  },