|
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/5e7dd90d2af9817b0dfb614b21c79a3e81882d9f", |
| 7 | + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/2918bd69cfcc658bd5b4ec1b106bb008e5c21120", |
8 | 8 | "name": "C#",
|
9 | 9 | "scopeName": "source.cs",
|
10 | 10 | "patterns": [
|
|
57 | 57 | "script-top-level": {
|
58 | 58 | "patterns": [
|
59 | 59 | {
|
60 |
| - "include": "#method-declaration" |
| 60 | + "include": "#statement" |
61 | 61 | },
|
62 | 62 | {
|
63 |
| - "include": "#statement" |
| 63 | + "include": "#method-declaration" |
64 | 64 | },
|
65 | 65 | {
|
66 | 66 | "include": "#punctuation-semicolon"
|
|
91 | 91 | "include": "#interface-declaration"
|
92 | 92 | },
|
93 | 93 | {
|
94 |
| - "include": "#record-declaration" |
| 94 | + "include": "#struct-declaration" |
95 | 95 | },
|
96 | 96 | {
|
97 |
| - "include": "#struct-declaration" |
| 97 | + "include": "#record-declaration" |
98 | 98 | },
|
99 | 99 | {
|
100 | 100 | "include": "#attribute-section"
|
|
421 | 421 | ]
|
422 | 422 | },
|
423 | 423 | {
|
424 |
| - "begin": "\\b(using)\\s*", |
| 424 | + "begin": "\\b(using)\\s*(?!\\(|\\s|var)", |
425 | 425 | "beginCaptures": {
|
426 | 426 | "1": {
|
427 | 427 | "name": "keyword.other.using.cs"
|
|
577 | 577 | "match": "(?<!\\.)\\b(new|public|protected|internal|private|abstract|virtual|override|sealed|static|partial|readonly|volatile|const|extern|async|unsafe|ref|required)\\b"
|
578 | 578 | },
|
579 | 579 | "class-declaration": {
|
580 |
| - "begin": "(?=\\bclass\\b)", |
581 |
| - "end": "(?<=\\})", |
| 580 | + "begin": "(?=(\\brecord\\b\\s+)?\\bclass\\b)", |
| 581 | + "end": "(?<=\\})|(?=;)", |
582 | 582 | "patterns": [
|
583 | 583 | {
|
584 |
| - "begin": "(?x)\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*", |
| 584 | + "begin": "(?x)\n(\\b(record)\\b\\s+)?\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*", |
585 | 585 | "beginCaptures": {
|
586 |
| - "1": { |
| 586 | + "2": { |
| 587 | + "name": "keyword.other.record.cs" |
| 588 | + }, |
| 589 | + "3": { |
587 | 590 | "name": "keyword.other.class.cs"
|
588 | 591 | },
|
589 |
| - "2": { |
| 592 | + "4": { |
590 | 593 | "name": "entity.name.type.class.cs"
|
591 | 594 | }
|
592 | 595 | },
|
593 |
| - "end": "(?=\\{)", |
| 596 | + "end": "(?=\\{)|(?=;)", |
594 | 597 | "patterns": [
|
595 | 598 | {
|
596 | 599 | "include": "#comment"
|
597 | 600 | },
|
598 | 601 | {
|
599 | 602 | "include": "#type-parameter-list"
|
600 | 603 | },
|
| 604 | + { |
| 605 | + "include": "#parenthesized-parameter-list" |
| 606 | + }, |
601 | 607 | {
|
602 | 608 | "include": "#base-types"
|
603 | 609 | },
|
|
820 | 826 | },
|
821 | 827 | "record-declaration": {
|
822 | 828 | "begin": "(?=\\brecord\\b)",
|
823 |
| - "end": "(?<=\\})", |
| 829 | + "end": "(?<=\\})|(?=;)", |
824 | 830 | "patterns": [
|
825 | 831 | {
|
826 | 832 | "begin": "(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
|
|
829 | 835 | "name": "keyword.other.record.cs"
|
830 | 836 | },
|
831 | 837 | "2": {
|
832 |
| - "name": "entity.name.type.record.cs" |
| 838 | + "name": "entity.name.type.class.cs" |
833 | 839 | }
|
834 | 840 | },
|
835 |
| - "end": "(?=\\{)", |
| 841 | + "end": "(?=\\{)|(?=;)", |
836 | 842 | "patterns": [
|
837 | 843 | {
|
838 | 844 | "include": "#comment"
|
839 | 845 | },
|
840 | 846 | {
|
841 | 847 | "include": "#type-parameter-list"
|
842 | 848 | },
|
| 849 | + { |
| 850 | + "include": "#parenthesized-parameter-list" |
| 851 | + }, |
843 | 852 | {
|
844 | 853 | "include": "#base-types"
|
845 | 854 | },
|
|
876 | 885 | ]
|
877 | 886 | },
|
878 | 887 | "struct-declaration": {
|
879 |
| - "begin": "(?=\\bstruct\\b)", |
880 |
| - "end": "(?<=\\})", |
| 888 | + "begin": "(?=(\\brecord\\b\\s+)?\\bstruct\\b)", |
| 889 | + "end": "(?<=\\})|(?=;)", |
881 | 890 | "patterns": [
|
882 | 891 | {
|
883 |
| - "begin": "(?x)\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", |
| 892 | + "begin": "(?x)\n(\\b(record)\\b\\s+)?\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", |
884 | 893 | "beginCaptures": {
|
885 |
| - "1": { |
| 894 | + "2": { |
| 895 | + "name": "keyword.other.record.cs" |
| 896 | + }, |
| 897 | + "3": { |
886 | 898 | "name": "keyword.other.struct.cs"
|
887 | 899 | },
|
888 |
| - "2": { |
| 900 | + "4": { |
889 | 901 | "name": "entity.name.type.struct.cs"
|
890 | 902 | }
|
891 | 903 | },
|
892 |
| - "end": "(?=\\{)", |
| 904 | + "end": "(?=\\{)|(?=;)", |
893 | 905 | "patterns": [
|
894 | 906 | {
|
895 | 907 | "include": "#comment"
|
896 | 908 | },
|
897 | 909 | {
|
898 | 910 | "include": "#type-parameter-list"
|
899 | 911 | },
|
| 912 | + { |
| 913 | + "include": "#parenthesized-parameter-list" |
| 914 | + }, |
900 | 915 | {
|
901 | 916 | "include": "#base-types"
|
902 | 917 | },
|
|
980 | 995 | "name": "punctuation.separator.colon.cs"
|
981 | 996 | }
|
982 | 997 | },
|
983 |
| - "end": "(?=\\{|where)", |
| 998 | + "end": "(?=\\{|where|;)", |
984 | 999 | "patterns": [
|
985 | 1000 | {
|
986 | 1001 | "include": "#type"
|
|
3006 | 3021 | "match": "(?<!\\.)\\bnull\\b"
|
3007 | 3022 | },
|
3008 | 3023 | "numeric-literal": {
|
3009 |
| - "match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.]|_)|(?<=[eE])[+-])*", |
| 3024 | + "match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_]|_)|(?<=[eE])[+-]|\\.\\d)*", |
3010 | 3025 | "captures": {
|
3011 | 3026 | "0": {
|
3012 | 3027 | "patterns": [
|
|
3152 | 3167 | }
|
3153 | 3168 | },
|
3154 | 3169 | {
|
3155 |
| - "match": "(?:(?:[0-9a-zA-Z_\\.]|_)|(?<=[eE])[+-])+", |
| 3170 | + "match": "(?:(?:[0-9a-zA-Z_]|_)|(?<=[eE])[+-]|\\.\\d)+", |
3156 | 3171 | "name": "invalid.illegal.constant.numeric.cs"
|
3157 | 3172 | }
|
3158 | 3173 | ]
|
|
0 commit comments