|
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/9ef19ad34df99e0e5bf3e0a8e8a1733d1f0c4aca", |
| 7 | + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/e7f564b60e08e6d8400d2512918c2ff5ccbf4cec", |
8 | 8 | "name": "C#", |
9 | 9 | "scopeName": "source.cs", |
10 | 10 | "fileTypes": [ |
|
275 | 275 | { |
276 | 276 | "include": "#nameof-expression" |
277 | 277 | }, |
| 278 | + { |
| 279 | + "include": "#throw-expression" |
| 280 | + }, |
278 | 281 | { |
279 | 282 | "include": "#interpolated-string" |
280 | 283 | }, |
|
614 | 617 | ] |
615 | 618 | }, |
616 | 619 | "delegate-declaration": { |
617 | | - "begin": "(?x)\n(?:\\b(delegate)\\b)\\s+\n(?<type-name>\n (?:\n (?:\n (?:(?<identifier>[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", |
| 620 | + "begin": "(?x)\n(?:\\b(delegate)\\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", |
618 | 621 | "beginCaptures": { |
619 | 622 | "1": { |
620 | 623 | "name": "keyword.other.delegate.cs" |
|
999 | 1002 | ] |
1000 | 1003 | }, |
1001 | 1004 | "property-declaration": { |
1002 | | - "begin": "(?x)\n(?!.*\\b(?:class|interface|struct|enum|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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<property-name>\\g<identifier>)\\s*\n(?=\\{|=>|$)", |
| 1005 | + "begin": "(?x)\n(?!.*\\b(?:class|interface|struct|enum|event)\\b)\\s*\n(?<return-type>\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<property-name>\\g<identifier>)\\s*\n(?=\\{|=>|$)", |
1003 | 1006 | "beginCaptures": { |
1004 | 1007 | "1": { |
1005 | 1008 | "patterns": [ |
|
1042 | 1045 | ] |
1043 | 1046 | }, |
1044 | 1047 | "indexer-declaration": { |
1045 | | - "begin": "(?x)\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<indexer-name>this)\\s*\n(?=\\[)", |
| 1048 | + "begin": "(?x)\n(?<return-type>\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<indexer-name>this)\\s*\n(?=\\[)", |
1046 | 1049 | "beginCaptures": { |
1047 | 1050 | "1": { |
1048 | 1051 | "patterns": [ |
|
1215 | 1218 | ] |
1216 | 1219 | }, |
1217 | 1220 | "method-declaration": { |
1218 | | - "begin": "(?x)\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", |
| 1221 | + "begin": "(?x)\n(?<return-type>\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(\\g<identifier>)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", |
1219 | 1222 | "beginCaptures": { |
1220 | 1223 | "1": { |
1221 | 1224 | "patterns": [ |
|
1351 | 1354 | ] |
1352 | 1355 | }, |
1353 | 1356 | "operator-declaration": { |
1354 | | - "begin": "(?x)\n(?<type-name>\n (?:\n (?:\n (?:(?<identifier>[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?<operator-keyword>(?:\\b(?:operator)))\\s*\n(?<operator>(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", |
| 1357 | + "begin": "(?x)\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?<operator-keyword>(?:\\b(?:operator)))\\s*\n(?<operator>(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", |
1355 | 1358 | "beginCaptures": { |
1356 | 1359 | "1": { |
1357 | 1360 | "patterns": [ |
|
1384 | 1387 | ] |
1385 | 1388 | }, |
1386 | 1389 | "conversion-operator-declaration": { |
1387 | | - "begin": "(?x)\n(?<explicit-or-implicit-keyword>(?:\\b(?:explicit|implicit)))\\s*\n(?<operator-keyword>(?:\\b(?:operator)))\\s*\n(?<type-name>\n (?:\n (?:\n (?:(?<identifier>[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", |
| 1390 | + "begin": "(?x)\n(?<explicit-or-implicit-keyword>(?:\\b(?:explicit|implicit)))\\s*\n(?<operator-keyword>(?:\\b(?:operator)))\\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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", |
1388 | 1391 | "beginCaptures": { |
1389 | 1392 | "1": { |
1390 | 1393 | "patterns": [ |
|
1461 | 1464 | }, |
1462 | 1465 | "end": "(?=[,\\)\\];}])", |
1463 | 1466 | "patterns": [ |
| 1467 | + { |
| 1468 | + "include": "#ref-modifier" |
| 1469 | + }, |
1464 | 1470 | { |
1465 | 1471 | "include": "#expression" |
1466 | 1472 | } |
|
1475 | 1481 | }, |
1476 | 1482 | "end": "(?=[,\\);}])", |
1477 | 1483 | "patterns": [ |
| 1484 | + { |
| 1485 | + "include": "#ref-modifier" |
| 1486 | + }, |
1478 | 1487 | { |
1479 | 1488 | "include": "#expression" |
1480 | 1489 | } |
|
1526 | 1535 | }, |
1527 | 1536 | "end": "(?=;)", |
1528 | 1537 | "patterns": [ |
| 1538 | + { |
| 1539 | + "include": "#ref-modifier" |
| 1540 | + }, |
1529 | 1541 | { |
1530 | 1542 | "include": "#expression" |
1531 | 1543 | } |
|
2122 | 2134 | ] |
2123 | 2135 | }, |
2124 | 2136 | "local-variable-declaration": { |
2125 | | - "begin": "(?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*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g<identifier>)\\s*\n(?=,|;|=|\\))", |
| 2137 | + "begin": "(?x)\n(?:\n (?:(\\bref)\\s+)?(\\bvar\\b)| # ref local\n (?<type-name>\n (?:\n (?:ref\\s+)? # ref local\n (?:\n (?:(?<identifier>[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g<identifier>)\\s*\n(?=,|;|=|\\))", |
2126 | 2138 | "beginCaptures": { |
2127 | 2139 | "1": { |
2128 | | - "name": "keyword.other.var.cs" |
| 2140 | + "name": "storage.modifier.cs" |
2129 | 2141 | }, |
2130 | 2142 | "2": { |
| 2143 | + "name": "keyword.other.var.cs" |
| 2144 | + }, |
| 2145 | + "3": { |
2131 | 2146 | "patterns": [ |
2132 | 2147 | { |
2133 | 2148 | "include": "#type" |
2134 | 2149 | } |
2135 | 2150 | ] |
2136 | 2151 | }, |
2137 | | - "7": { |
| 2152 | + "8": { |
2138 | 2153 | "name": "entity.name.variable.local.cs" |
2139 | 2154 | } |
2140 | 2155 | }, |
|
2405 | 2420 | } |
2406 | 2421 | ] |
2407 | 2422 | }, |
| 2423 | + "throw-expression": { |
| 2424 | + "begin": "(?<!\\.)\\b(throw)\\b", |
| 2425 | + "beginCaptures": { |
| 2426 | + "1": { |
| 2427 | + "name": "keyword.control.flow.throw.cs" |
| 2428 | + } |
| 2429 | + }, |
| 2430 | + "end": "(?=;)", |
| 2431 | + "patterns": [ |
| 2432 | + { |
| 2433 | + "include": "#expression" |
| 2434 | + } |
| 2435 | + ] |
| 2436 | + }, |
2408 | 2437 | "interpolated-string": { |
2409 | 2438 | "name": "string.quoted.double.cs", |
2410 | 2439 | "begin": "\\$\"", |
|
3460 | 3489 | { |
3461 | 3490 | "include": "#block" |
3462 | 3491 | }, |
| 3492 | + { |
| 3493 | + "include": "#ref-modifier" |
| 3494 | + }, |
3463 | 3495 | { |
3464 | 3496 | "include": "#expression" |
3465 | 3497 | } |
|
3487 | 3519 | { |
3488 | 3520 | "include": "#block" |
3489 | 3521 | }, |
| 3522 | + { |
| 3523 | + "include": "#ref-modifier" |
| 3524 | + }, |
3490 | 3525 | { |
3491 | 3526 | "include": "#expression" |
3492 | 3527 | } |
|
3569 | 3604 | { |
3570 | 3605 | "include": "#comment" |
3571 | 3606 | }, |
| 3607 | + { |
| 3608 | + "include": "#ref-modifier" |
| 3609 | + }, |
3572 | 3610 | { |
3573 | 3611 | "include": "#tuple-type" |
3574 | 3612 | }, |
|
3589 | 3627 | } |
3590 | 3628 | ] |
3591 | 3629 | }, |
| 3630 | + "ref-modifier": { |
| 3631 | + "name": "storage.modifier.cs", |
| 3632 | + "match": "ref" |
| 3633 | + }, |
3592 | 3634 | "tuple-type": { |
3593 | 3635 | "begin": "\\(", |
3594 | 3636 | "beginCaptures": { |
|
0 commit comments