From 50b3c04d0abe22d19371e2a43e3d1b68fb59bed7 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 9 Oct 2023 12:33:40 +0200 Subject: [PATCH] Revert C# grammar to last-known-good commit (#195144) * Revert C# grammar back to last-known-good commit Part of #195098 * Also add missing test_cshtml.json test result * Add new test for issue --- extensions/csharp/cgmanifest.json | 4 +- .../csharp/syntaxes/csharp.tmLanguage.json | 1956 ++++++----------- .../test/colorize-fixtures/test.cs | 4 + .../test/colorize-results/test_cs.json | 656 +++++- .../test/colorize-results/test_cshtml.json | 110 +- 5 files changed, 1271 insertions(+), 1459 deletions(-) diff --git a/extensions/csharp/cgmanifest.json b/extensions/csharp/cgmanifest.json index cd80dd226f5..176ee56da48 100644 --- a/extensions/csharp/cgmanifest.json +++ b/extensions/csharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "dotnet/csharp-tmLanguage", "repositoryUrl": "https://github.com/dotnet/csharp-tmLanguage", - "commitHash": "29a37e5e2d66deefe5a06afad793a820871f4fdf" + "commitHash": "772323937fedd65c6dc1c8ce6ea41d97415ed7d1" } }, "license": "MIT", @@ -15,4 +15,4 @@ } ], "version": 1 -} \ No newline at end of file +} diff --git a/extensions/csharp/syntaxes/csharp.tmLanguage.json b/extensions/csharp/syntaxes/csharp.tmLanguage.json index ee0a7fac2a8..c4266da462d 100644 --- a/extensions/csharp/syntaxes/csharp.tmLanguage.json +++ b/extensions/csharp/syntaxes/csharp.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/dotnet/csharp-tmLanguage/commit/29a37e5e2d66deefe5a06afad793a820871f4fdf", + "version": "https://github.com/dotnet/csharp-tmLanguage/commit/772323937fedd65c6dc1c8ce6ea41d97415ed7d1", "name": "C#", "scopeName": "source.cs", "patterns": [ @@ -210,6 +210,9 @@ { "include": "#else-part" }, + { + "include": "#switch-statement" + }, { "include": "#goto-statement" }, @@ -235,10 +238,10 @@ "include": "#checked-unchecked-statement" }, { - "include": "#context-control-statement" + "include": "#lock-statement" }, { - "include": "#context-control-paren-statement" + "include": "#using-statement" }, { "include": "#labeled-statement" @@ -275,10 +278,13 @@ "include": "#comment" }, { - "include": "#expression-operator-expression" + "include": "#checked-unchecked-expression" }, { - "include": "#type-operator-expression" + "include": "#typeof-or-default-expression" + }, + { + "include": "#nameof-expression" }, { "include": "#default-literal-expression" @@ -299,20 +305,14 @@ "include": "#type-builtin" }, { - "include": "#language-variable" + "include": "#this-or-base-expression" }, { - "include": "#switch-statement-or-expression" - }, - { - "include": "#with-expression" + "include": "#switch-expression" }, { "include": "#conditional-operator" }, - { - "include": "#assignment-expression" - }, { "include": "#expression-operators" }, @@ -370,39 +370,36 @@ ] }, "extern-alias-directive": { - "begin": "\\b(extern)\\s+(alias)\\b", + "begin": "\\s*(extern)\\b\\s*(alias)\\b\\s*(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { - "name": "keyword.other.directive.extern.cs" + "name": "keyword.other.extern.cs" }, "2": { - "name": "keyword.other.directive.alias.cs" - } - }, - "end": "(?=;)", - "patterns": [ - { - "match": "\\@?[_[:alpha:]][_[:alnum:]]*", + "name": "keyword.other.alias.cs" + }, + "3": { "name": "variable.other.alias.cs" } - ] + }, + "end": "(?=;)" }, "using-directive": { "patterns": [ { - "begin": "\\b(?:(global)\\s+)?(using)\\s+(static)\\b\\s*(?:(unsafe)\\b\\s*)?", + "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(static)\\b\\s+(\\b(unsafe)\\b\\s+)?", "beginCaptures": { - "1": { - "name": "keyword.other.directive.global.cs" - }, "2": { - "name": "keyword.other.directive.using.cs" + "name": "keyword.other.global.cs" }, "3": { - "name": "keyword.other.directive.static.cs" + "name": "keyword.other.using.cs" }, "4": { - "name": "storage.modifier.unsafe.cs" + "name": "keyword.other.static.cs" + }, + "6": { + "name": "storage.modifier.cs" } }, "end": "(?=;)", @@ -413,22 +410,19 @@ ] }, { - "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*(?:(unsafe)\\b\\s*)?(@?[_[:alpha:]][_[:alnum:]]*)\\s*(=)", + "begin": "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(\\b(unsafe)\\b\\s+)?(?=(@?[_[:alpha:]][_[:alnum:]]*)\\s*=)", "beginCaptures": { - "1": { - "name": "keyword.other.directive.global.cs" - }, "2": { - "name": "keyword.other.directive.using.cs" + "name": "keyword.other.global.cs" }, "3": { - "name": "storage.modifier.unsafe.cs" - }, - "4": { - "name": "entity.name.type.alias.cs" + "name": "keyword.other.using.cs" }, "5": { - "name": "keyword.operator.assignment.cs" + "name": "storage.modifier.cs" + }, + "6": { + "name": "entity.name.type.alias.cs" } }, "end": "(?=;)", @@ -438,17 +432,20 @@ }, { "include": "#type" + }, + { + "include": "#operator-assignment" } ] }, { - "begin": "\\b(?:(global)\\s+)?(using)\\b\\s*+(?!\\(|var\\b)", + "begin": "(\\b(global)\\b\\s+)?\\b(using)\\s*(?!\\(|\\s|var)", "beginCaptures": { - "1": { - "name": "keyword.other.directive.global.cs" - }, "2": { - "name": "keyword.other.directive.using.cs" + "name": "keyword.other.global.cs" + }, + "3": { + "name": "keyword.other.using.cs" } }, "end": "(?=;)", @@ -458,10 +455,7 @@ }, { "name": "entity.name.type.namespace.cs", - "match": "\\@?[_[:alpha:]][_[:alnum:]]*" - }, - { - "include": "#punctuation-accessor" + "match": "@?[_[:alpha:]][_[:alnum:]]*" }, { "include": "#operator-assignment" @@ -557,7 +551,7 @@ "begin": "\\b(namespace)\\s+", "beginCaptures": { "1": { - "name": "storage.type.namespace.cs" + "name": "keyword.other.namespace.cs" } }, "end": "(?<=\\})|(?=;)", @@ -600,7 +594,7 @@ ] }, "storage-modifier": { - "name": "storage.modifier.$1.cs", + "name": "storage.modifier.cs", "match": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", "beginCaptures": { "1": { - "name": "storage.type.delegate.cs" + "name": "keyword.other.delegate.cs" }, "2": { "patterns": [ @@ -718,7 +712,7 @@ "match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)", "captures": { "1": { - "name": "storage.type.enum.cs" + "name": "keyword.other.enum.cs" }, "2": { "name": "entity.name.type.enum.cs" @@ -802,7 +796,7 @@ "begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { - "name": "storage.type.interface.cs" + "name": "keyword.other.interface.cs" }, "2": { "name": "entity.name.type.interface.cs" @@ -859,7 +853,7 @@ "begin": "(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "1": { - "name": "storage.type.record.cs" + "name": "keyword.other.record.cs" }, "2": { "name": "entity.name.type.class.cs" @@ -919,10 +913,10 @@ "begin": "(?x)\n(\\b(record)\\b\\s+)?\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", "beginCaptures": { "2": { - "name": "storage.type.record.cs" + "name": "keyword.other.record.cs" }, "3": { - "name": "storage.type.struct.cs" + "name": "keyword.other.struct.cs" }, "4": { "name": "entity.name.type.struct.cs" @@ -990,11 +984,19 @@ "patterns": [ { "match": "\\b(in|out)\\b", - "name": "storage.modifier.$1.cs" + "captures": { + "1": { + "name": "storage.modifier.cs" + } + } }, { "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b", - "name": "entity.name.type.type-parameter.cs" + "captures": { + "1": { + "name": "entity.name.type.type-parameter.cs" + } + } }, { "include": "#comment" @@ -1031,7 +1033,7 @@ "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)", "beginCaptures": { "1": { - "name": "storage.modifier.where.cs" + "name": "keyword.other.where.cs" }, "2": { "name": "entity.name.type.type-parameter.cs" @@ -1043,18 +1045,18 @@ "end": "(?=\\{|where|;|=>)", "patterns": [ { - "name": "storage.type.class.cs", + "name": "keyword.other.class.cs", "match": "\\bclass\\b" }, { - "name": "storage.type.struct.cs", + "name": "keyword.other.struct.cs", "match": "\\bstruct\\b" }, { "match": "(new)\\s*(\\()\\s*(\\))", "captures": { "1": { - "name": "keyword.operator.expression.new.cs" + "name": "keyword.other.new.cs" }, "2": { "name": "punctuation.parenthesis.open.cs" @@ -1110,7 +1112,7 @@ ] }, "property-declaration": { - "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(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|//|/\\*|$)", + "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(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|$)", "beginCaptures": { "1": { "patterns": [ @@ -1142,7 +1144,7 @@ "include": "#property-accessors" }, { - "include": "#accessor-getter-expression" + "include": "#expression-body" }, { "include": "#variable-initializer" @@ -1173,7 +1175,7 @@ ] }, "8": { - "name": "variable.language.this.cs" + "name": "keyword.other.this.cs" } }, "end": "(?<=\\})|(?=;)", @@ -1188,7 +1190,7 @@ "include": "#property-accessors" }, { - "include": "#accessor-getter-expression" + "include": "#expression-body" }, { "include": "#variable-initializer" @@ -1196,10 +1198,10 @@ ] }, "event-declaration": { - "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?\\g\\s*\\.\\s*)?\n(\\g)\\s* # first event name\n(?=\\{|;|,|=|//|/\\*|$)", + "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)", "beginCaptures": { "1": { - "name": "storage.type.event.cs" + "name": "keyword.other.event.cs" }, "2": { "patterns": [ @@ -1219,7 +1221,15 @@ ] }, "9": { - "name": "entity.name.variable.event.cs" + "patterns": [ + { + "name": "entity.name.variable.event.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-comma" + } + ] } }, "end": "(?<=\\})|(?=;)", @@ -1230,29 +1240,8 @@ { "include": "#event-accessors" }, - { - "name": "entity.name.variable.event.cs", - "match": "@?[_[:alpha:]][_[:alnum:]]*" - }, { "include": "#punctuation-comma" - }, - { - "begin": "=", - "beginCaptures": { - "0": { - "name": "keyword.operator.assignment.cs" - } - }, - "end": "(?<=,)|(?=;)", - "patterns": [ - { - "include": "#expression" - }, - { - "include": "#punctuation-comma" - } - ] } ] }, @@ -1270,6 +1259,22 @@ } }, "patterns": [ + { + "name": "storage.modifier.cs", + "match": "\\b(private|protected|internal)\\b" + }, + { + "name": "keyword.other.get.cs", + "match": "\\b(get)\\b" + }, + { + "name": "keyword.other.set.cs", + "match": "\\b(set)\\b" + }, + { + "name": "keyword.other.init.cs", + "match": "\\b(init)\\b" + }, { "include": "#comment" }, @@ -1277,36 +1282,13 @@ "include": "#attribute-section" }, { - "name": "storage.modifier.$1.cs", - "match": "\\b(private|protected|internal)\\b" + "include": "#expression-body" }, { - "begin": "\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", - "beginCaptures": { - "1": { - "name": "storage.type.accessor.$1.cs" - } - }, - "end": "(?<=\\}|;)|(?=\\})", - "patterns": [ - { - "include": "#accessor-getter" - } - ] + "include": "#block" }, { - "begin": "\\b(set|init)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", - "beginCaptures": { - "1": { - "name": "storage.type.accessor.$1.cs" - } - }, - "end": "(?<=\\}|;)|(?=\\})", - "patterns": [ - { - "include": "#accessor-setter" - } - ] + "include": "#punctuation-semicolon" } ] }, @@ -1324,6 +1306,14 @@ } }, "patterns": [ + { + "name": "keyword.other.add.cs", + "match": "\\b(add)\\b" + }, + { + "name": "keyword.other.remove.cs", + "match": "\\b(remove)\\b" + }, { "include": "#comment" }, @@ -1331,108 +1321,10 @@ "include": "#attribute-section" }, { - "begin": "\\b(add|remove)\\b\\s*(?=\\{|;|=>|//|/\\*|$)", - "beginCaptures": { - "1": { - "name": "storage.type.accessor.$1.cs" - } - }, - "end": "(?<=\\}|;)|(?=\\})", - "patterns": [ - { - "include": "#accessor-setter" - } - ] - } - ] - }, - "accessor-getter": { - "patterns": [ - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.curlybrace.open.cs" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.curlybrace.close.cs" - } - }, - "contentName": "meta.accessor.getter.cs", - "patterns": [ - { - "include": "#statement" - } - ] + "include": "#expression-body" }, { - "include": "#accessor-getter-expression" - }, - { - "include": "#punctuation-semicolon" - } - ] - }, - "accessor-getter-expression": { - "begin": "=>", - "beginCaptures": { - "0": { - "name": "keyword.operator.arrow.cs" - } - }, - "end": "(?=;|\\})", - "contentName": "meta.accessor.getter.cs", - "patterns": [ - { - "include": "#ref-modifier" - }, - { - "include": "#expression" - } - ] - }, - "accessor-setter": { - "patterns": [ - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.curlybrace.open.cs" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.curlybrace.close.cs" - } - }, - "contentName": "meta.accessor.setter.cs", - "patterns": [ - { - "include": "#statement" - } - ] - }, - { - "begin": "=>", - "beginCaptures": { - "0": { - "name": "keyword.operator.arrow.cs" - } - }, - "end": "(?=;|\\})", - "contentName": "meta.accessor.setter.cs", - "patterns": [ - { - "include": "#ref-modifier" - }, - { - "include": "#expression" - } - ] + "include": "#block" }, { "include": "#punctuation-semicolon" @@ -1533,10 +1425,13 @@ ] }, "constructor-initializer": { - "begin": "\\b(base|this)\\b\\s*(?=\\()", + "begin": "\\b(?:(base)|(this))\\b\\s*(?=\\()", "beginCaptures": { "1": { - "name": "variable.language.$1.cs" + "name": "keyword.other.base.cs" + }, + "2": { + "name": "keyword.other.this.cs" } }, "end": "(?<=\\))", @@ -1573,7 +1468,7 @@ ] }, "operator-declaration": { - "begin": "(?x)\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n(?[+\\-*/%&|\\^!=~<>]+|true|false)\\s*\n(?=\\()", + "begin": "(?x)\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", "beginCaptures": { "1": { "patterns": [ @@ -1583,7 +1478,7 @@ ] }, "6": { - "name": "storage.type.operator.cs" + "name": "keyword.other.operator-decl.cs" }, "7": { "name": "entity.name.function.cs" @@ -1614,7 +1509,7 @@ "match": "\\b(explicit)\\b", "captures": { "1": { - "name": "storage.modifier.explicit.cs" + "name": "keyword.other.explicit.cs" } } }, @@ -1622,14 +1517,14 @@ "match": "\\b(implicit)\\b", "captures": { "1": { - "name": "storage.modifier.implicit.cs" + "name": "keyword.other.implicit.cs" } } } ] }, "2": { - "name": "storage.type.operator.cs" + "name": "keyword.other.operator-decl.cs" }, "3": { "patterns": [ @@ -1712,19 +1607,19 @@ "begin": "(?", - "beginCaptures": { - "0": { - "name": "keyword.operator.arrow.cs" - } - }, - "end": "(?=,|})", - "patterns": [ - { - "include": "#expression" - } - ] - }, - { - "begin": "\\b(when)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.conditional.when.cs" - } - }, - "end": "(?==>|,|})", - "patterns": [ - { - "include": "#case-guard" - } - ] - }, - { - "begin": "(?!\\s)", - "end": "(?=\\bwhen\\b|=>|,|})", - "patterns": [ - { - "include": "#pattern" - } - ] - } - ] - }, - "case-guard": { - "patterns": [ - { - "include": "#parenthesized-expression" - }, - { - "include": "#expression" - } - ] - }, - "is-expression": { - "begin": "(?=?", - "beginCaptures": { - "0": { - "name": "keyword.operator.relational.cs" - } - }, - "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#expression" - } - ] - }, - "var-pattern": { - "begin": "\\b(var)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.var.cs" - } - }, - "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#designation-pattern" - } - ] - }, - "designation-pattern": { - "patterns": [ - { - "include": "#intrusive" - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.parenthesis.open.cs" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.parenthesis.close.cs" - } - }, - "patterns": [ - { - "include": "#punctuation-comma" - }, - { - "include": "#designation-pattern" - } - ] - }, - { - "include": "#simple-designation-pattern" - } - ] - }, - "simple-designation-pattern": { - "patterns": [ - { - "include": "#discard-pattern" - }, - { - "match": "@?[_[:alpha:]][_[:alnum:]]*", - "name": "entity.name.variable.local.cs" - } - ] - }, - "type-pattern": { - "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*)", - "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "begin": "\\G", - "end": "(?!\\G[@_[:alpha:]])(?=[\\({@_[:alpha:])}\\],;:=&|^]|(?:\\s|^)\\?|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#intrusive" - }, - { - "include": "#type-subpattern" - } - ] - }, - { - "begin": "(?=[\\({@_[:alpha:]])", - "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#intrusive" - }, - { - "include": "#positional-pattern" - }, - { - "include": "#property-pattern" - }, - { - "include": "#simple-designation-pattern" - } - ] - } - ] - }, - "type-subpattern": { - "patterns": [ - { - "include": "#type-builtin" - }, - { - "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(::)", - "beginCaptures": { - "1": { - "name": "entity.name.type.alias.cs" - }, - "2": { - "name": "punctuation.separator.coloncolon.cs" - } - }, - "end": "(?<=[_[:alnum:]])|(?=[.<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#intrusive" - }, - { - "match": "\\@?[_[:alpha:]][_[:alnum:]]*", - "name": "entity.name.type.cs" - } - ] - }, - { - "match": "\\@?[_[:alpha:]][_[:alnum:]]*", - "name": "entity.name.type.cs" - }, - { - "begin": "\\.", - "beginCaptures": { - "0": { - "name": "punctuation.accessor.cs" - } - }, - "end": "(?<=[_[:alnum:]])|(?=[<\\[\\({)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", - "patterns": [ - { - "include": "#intrusive" - }, - { - "match": "\\@?[_[:alpha:]][_[:alnum:]]*", - "name": "entity.name.type.cs" - } - ] - }, - { - "include": "#type-arguments" - }, - { - "include": "#type-array-suffix" - }, - { - "match": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "2": { + "name": "entity.name.variable.local.cs" + } + }, + "end": "(?==>)", "patterns": [ { - "match": "(@?[_[:alpha:]][_[:alnum:]]*(?:\\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*)*)\\s*(:)", + "include": "#comment" + }, + { + "include": "#switch-when-clause" + } + ] + }, + "switch-property-expression": { + "begin": "(?x) # e.g. int x OR var x\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(\\{)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "switch-var-pattern": { + "begin": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*", + "beginCaptures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#tuple-declaration-deconstruction-element-list" + } + ] + } + }, + "end": "(?==>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#switch-when-clause" + } + ] + }, + "switch-when-clause": { + "begin": "(?)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + }, + { + "match": "\\(", + "captures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + } + }, + { + "match": "\\)", + "captures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + } + } + ] + }, + "switch-label": { + "patterns": [ + { + "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s+\n\\b(in)\\b", "captures": { "1": { - "name": "storage.type.var.cs" + "name": "keyword.other.var.cs" }, "2": { "patterns": [ @@ -2719,7 +2176,7 @@ "match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s+\n\\b(in)\\b", "captures": { "1": { - "name": "storage.type.var.cs" + "name": "keyword.other.var.cs" }, "2": { "patterns": [ @@ -2737,6 +2194,9 @@ "include": "#expression" } ] + }, + { + "include": "#statement" } ] }, @@ -2757,7 +2217,7 @@ "begin": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s*\n(?!=>)\n(?=,|;|=|\\))", + "begin": "(?x)\n(?:\n (?:(\\busing)\\s+)?\n (?:(\\bref)\\s+(?:(\\breadonly)\\s+)?)?(\\bvar\\b)| # ref local\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s*\n(?!=>)\n(?=,|;|=|\\))", "beginCaptures": { "1": { - "name": "storage.modifier.ref.cs" + "name": "keyword.other.using.cs" }, "2": { - "name": "storage.modifier.readonly.cs" + "name": "storage.modifier.cs" }, "3": { - "name": "storage.type.var.cs" + "name": "storage.modifier.cs" }, "4": { + "name": "keyword.other.var.cs" + }, + "5": { "patterns": [ { "include": "#type" } ] }, - "9": { + "10": { "name": "entity.name.variable.local.cs" } }, - "end": "(?=[;)}])", + "end": "(?=;|\\))", "patterns": [ { "name": "entity.name.variable.local.cs", @@ -3068,7 +2486,7 @@ "begin": "(?x)\n(?\\b(?:const)\\b)\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s*\n(?=,|;|=)", "beginCaptures": { "1": { - "name": "storage.modifier.const.cs" + "name": "storage.modifier.cs" }, "2": { "patterns": [ @@ -3099,49 +2517,9 @@ ] }, "local-function-declaration": { - "begin": "(?x)\n\\b((?:(?:async|unsafe|static|extern)\\s+)*)\n(?\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\s*\n(<[^<>]+>)?\\s*\n(?=\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "include": "#storage-modifier" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#type" - } - ] - }, - "7": { - "name": "entity.name.function.cs" - }, - "8": { - "patterns": [ - { - "include": "#type-parameter-list" - } - ] - } - }, - "end": "(?<=\\})|(?=;)", "patterns": [ { - "include": "#comment" - }, - { - "include": "#parenthesized-parameter-list" - }, - { - "include": "#generic-constraints" - }, - { - "include": "#expression-body" - }, - { - "include": "#block" + "include": "#method-declaration" } ] }, @@ -3149,7 +2527,7 @@ "begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?=;|=|\\))", "beginCaptures": { "1": { - "name": "storage.type.var.cs" + "name": "keyword.other.var.cs" }, "2": { "patterns": [ @@ -3257,7 +2635,7 @@ "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n(?=[,)\\]])", "captures": { "1": { - "name": "storage.type.var.cs" + "name": "keyword.other.var.cs" }, "2": { "patterns": [ @@ -3275,7 +2653,7 @@ "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n(?=[,)])", "captures": { "1": { - "name": "storage.type.var.cs" + "name": "keyword.other.var.cs" }, "2": { "patterns": [ @@ -3289,11 +2667,61 @@ } } }, - "expression-operator-expression": { - "begin": "\\b(checked|unchecked|nameof)\\s*(\\()", + "checked-unchecked-expression": { + "begin": "(?>>?|\\|)?=(?!=|>)", - "beginCaptures": { - "0": { - "patterns": [ - { - "include": "#assignment-operators" - } - ] - } - }, - "end": "(?=[,\\)\\];}])", - "patterns": [ - { - "include": "#ref-modifier" - }, - { - "include": "#expression" - } - ] - }, - "assignment-operators": { + "expression-operators": { "patterns": [ { "name": "keyword.operator.assignment.compound.cs", @@ -4006,19 +3391,11 @@ }, { "name": "keyword.operator.assignment.compound.bitwise.cs", - "match": "\\&=|\\^=|<<=|>>>?=|\\|=" + "match": "\\&=|\\^=|<<=|>>=|\\|=" }, - { - "name": "keyword.operator.assignment.cs", - "match": "\\=" - } - ] - }, - "expression-operators": { - "patterns": [ { "name": "keyword.operator.bitwise.shift.cs", - "match": "<<|>>>?" + "match": "<<|>>" }, { "name": "keyword.operator.comparison.cs", @@ -4036,6 +3413,10 @@ "name": "keyword.operator.bitwise.cs", "match": "\\&|~|\\^|\\|" }, + { + "name": "keyword.operator.assignment.cs", + "match": "\\=" + }, { "name": "keyword.operator.decrement.cs", "match": "--" @@ -4046,50 +3427,56 @@ }, { "name": "keyword.operator.arithmetic.cs", - "match": "\\+|-(?!>)|\\*|/|%" + "match": "%|\\*|/|-|\\+" }, { "name": "keyword.operator.null-coalescing.cs", "match": "\\?\\?" - }, - { - "name": "keyword.operator.range.cs", - "match": "\\.\\." } ] }, - "with-expression": { - "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)?", "captures": { "1": { - "name": "keyword.operator.expression.as.cs" + "name": "keyword.other.as.cs" }, "2": { "patterns": [ @@ -4169,20 +3556,34 @@ } } }, - "language-variable": { - "patterns": [ - { - "name": "variable.language.$1.cs", - "match": "\\b(base|this)\\b" + "is-expression": { + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)?", + "captures": { + "1": { + "name": "keyword.other.is.cs" }, - { - "name": "variable.other.$1.cs", - "match": "\\b(value)\\b" + "2": { + "patterns": [ + { + "include": "#type" + } + ] } - ] + } + }, + "this-or-base-expression": { + "match": "\\b(?:(base)|(this))\\b", + "captures": { + "1": { + "name": "keyword.other.base.cs" + }, + "2": { + "name": "keyword.other.this.cs" + } + } }, "invocation-expression": { - "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 (?\n [^<>()]+|\n <\\g+>|\n \\(\\g+\\)\n )+\n >\\s*\n)? # type arguments\n(?=\\() # open paren of argument list", + "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?\\s*<([^<>]|\\g)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list", "beginCaptures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -4191,12 +3592,9 @@ "name": "punctuation.accessor.cs" }, "3": { - "name": "punctuation.accessor.pointer.cs" - }, - "4": { "name": "entity.name.function.cs" }, - "5": { + "4": { "patterns": [ { "include": "#type-arguments" @@ -4212,7 +3610,7 @@ ] }, "element-access-expression": { - "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", + "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", "beginCaptures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -4221,12 +3619,9 @@ "name": "punctuation.accessor.cs" }, "3": { - "name": "punctuation.accessor.pointer.cs" - }, - "4": { "name": "variable.other.object.property.cs" }, - "5": { + "4": { "name": "keyword.operator.null-conditional.cs" } }, @@ -4240,7 +3635,7 @@ "member-access-expression": { "patterns": [ { - "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 ?[", + "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 ?[", "captures": { "1": { "name": "keyword.operator.null-conditional.cs" @@ -4249,9 +3644,6 @@ "name": "punctuation.accessor.cs" }, "3": { - "name": "punctuation.accessor.pointer.cs" - }, - "4": { "name": "variable.other.object.property.cs" } } @@ -4275,7 +3667,7 @@ } }, { - "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n \\s*(?:(?:\\?\\s*)?\\.|->)\n \\s*@?[_[:alpha:]][_[:alnum:]]*\n)", + "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)", "captures": { "1": { "name": "variable.other.object.cs" @@ -4298,7 +3690,7 @@ "begin": "(?x)\n(new)(?:\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?=\\()", "beginCaptures": { "1": { - "name": "keyword.operator.expression.new.cs" + "name": "keyword.other.new.cs" }, "2": { "patterns": [ @@ -4316,10 +3708,10 @@ ] }, "object-creation-expression-with-no-parameters": { - "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?=\\{|//|/\\*|$)", + "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?=\\{|$)", "captures": { "1": { - "name": "keyword.operator.expression.new.cs" + "name": "keyword.other.new.cs" }, "2": { "patterns": [ @@ -4334,7 +3726,7 @@ "begin": "(?x)\n\\b(new|stackalloc)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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(?=\\[)", "beginCaptures": { "1": { - "name": "keyword.operator.expression.$1.cs" + "name": "keyword.other.new.cs" }, "2": { "patterns": [ @@ -4352,17 +3744,14 @@ ] }, "anonymous-object-creation-expression": { - "begin": "\\b(new)\\b\\s*(?=\\{|//|/\\*|$)", + "begin": "\\b(new)\\b\\s*(?=\\{|$)", "beginCaptures": { "1": { - "name": "keyword.operator.expression.new.cs" + "name": "keyword.other.new.cs" } }, "end": "(?<=\\})", "patterns": [ - { - "include": "#comment" - }, { "include": "#initializer-expression" } @@ -4437,10 +3826,10 @@ ] }, "parameter": { - "match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^()]|\\g)+\\))\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)", + "match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)", "captures": { "1": { - "name": "storage.modifier.$1.cs" + "name": "storage.modifier.cs" }, "2": { "patterns": [ @@ -4524,25 +3913,11 @@ "argument": { "patterns": [ { - "name": "storage.modifier.$1.cs", - "match": "\\b(ref|in)\\b" + "name": "storage.modifier.cs", + "match": "\\b(ref|out|in)\\b" }, { - "begin": "\\b(out)\\b", - "beginCaptures": { - "1": { - "name": "storage.modifier.out.cs" - } - }, - "end": "(?=,|\\)|\\])", - "patterns": [ - { - "include": "#declaration-expression-local" - }, - { - "include": "#expression" - } - ] + "include": "#declaration-expression-local" }, { "include": "#expression" @@ -4553,7 +3928,7 @@ "begin": "(?x)\n\\b(from)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.from.cs" + "name": "keyword.query.from.cs" }, "2": { "patterns": [ @@ -4566,7 +3941,7 @@ "name": "entity.name.variable.range-variable.cs" }, "8": { - "name": "keyword.operator.expression.query.in.cs" + "name": "keyword.query.in.cs" } }, "end": "(?=;|\\))", @@ -4605,7 +3980,7 @@ "begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.let.cs" + "name": "keyword.query.let.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4628,7 +4003,7 @@ "begin": "(?x)\n\\b(where)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.where.cs" + "name": "keyword.query.where.cs" } }, "end": "(?=;|\\))", @@ -4645,7 +4020,7 @@ "begin": "(?x)\n\\b(join)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.join.cs" + "name": "keyword.query.join.cs" }, "2": { "patterns": [ @@ -4658,7 +4033,7 @@ "name": "entity.name.variable.range-variable.cs" }, "8": { - "name": "keyword.operator.expression.query.in.cs" + "name": "keyword.query.in.cs" } }, "end": "(?=;|\\))", @@ -4684,7 +4059,7 @@ "match": "\\b(on)\\b\\s*", "captures": { "1": { - "name": "keyword.operator.expression.query.on.cs" + "name": "keyword.query.on.cs" } } }, @@ -4692,7 +4067,7 @@ "match": "\\b(equals)\\b\\s*", "captures": { "1": { - "name": "keyword.operator.expression.query.equals.cs" + "name": "keyword.query.equals.cs" } } }, @@ -4700,7 +4075,7 @@ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", "captures": { "1": { - "name": "keyword.operator.expression.query.into.cs" + "name": "keyword.query.into.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4711,7 +4086,7 @@ "begin": "\\b(orderby)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.orderby.cs" + "name": "keyword.query.orderby.cs" } }, "end": "(?=;|\\))", @@ -4731,10 +4106,13 @@ ] }, "ordering-direction": { - "match": "\\b(ascending|descending)\\b", + "match": "\\b(?:(ascending)|(descending))\\b", "captures": { "1": { - "name": "keyword.operator.expression.query.$1.cs" + "name": "keyword.query.ascending.cs" + }, + "2": { + "name": "keyword.query.descending.cs" } } }, @@ -4742,7 +4120,7 @@ "begin": "\\b(select)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.select.cs" + "name": "keyword.query.select.cs" } }, "end": "(?=;|\\))", @@ -4759,7 +4137,7 @@ "begin": "\\b(group)\\b\\s*", "beginCaptures": { "1": { - "name": "keyword.operator.expression.query.group.cs" + "name": "keyword.query.group.cs" } }, "end": "(?=;|\\))", @@ -4782,7 +4160,7 @@ "match": "\\b(by)\\b\\s*", "captures": { "1": { - "name": "keyword.operator.expression.query.by.cs" + "name": "keyword.query.by.cs" } } }, @@ -4790,7 +4168,7 @@ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", "captures": { "1": { - "name": "keyword.operator.expression.query.into.cs" + "name": "keyword.query.into.cs" }, "2": { "name": "entity.name.variable.range-variable.cs" @@ -4800,138 +4178,119 @@ "anonymous-method-expression": { "patterns": [ { - "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\b|\n (\\()\n (?(?:[^()]|\\(\\g\\))*)\n (\\))\n)\\s*\n(=>)", + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)", "beginCaptures": { "1": { - "patterns": [ - { - "match": "async|static", - "name": "storage.modifier.$0.cs" - } - ] + "name": "storage.modifier.cs" }, "2": { "name": "entity.name.variable.parameter.cs" }, "3": { - "name": "punctuation.parenthesis.open.cs" - }, - "4": { - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#explicit-anonymous-function-parameter" - }, - { - "include": "#implicit-anonymous-function-parameter" - }, - { - "include": "#default-argument" - }, - { - "include": "#punctuation-comma" - } - ] - }, - "5": { - "name": "punctuation.parenthesis.close.cs" - }, - "6": { "name": "keyword.operator.arrow.cs" } }, - "end": "(?=[,;)}])", + "end": "(?=\\)|;|}|,)", "patterns": [ { - "include": "#intrusive" + "include": "#block" }, { - "begin": "(?={)", - "end": "(?=[,;)}])", - "patterns": [ - { - "include": "#block" - }, - { - "include": "#intrusive" - } - ] + "include": "#ref-modifier" }, { - "begin": "\\b(ref)\\b|(?=\\S)", - "beginCaptures": { - "1": { - "name": "storage.modifier.ref.cs" - } - }, - "end": "(?=[,;)}])", - "patterns": [ - { - "include": "#expression" - } - ] + "include": "#expression" } ] }, { - "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n\\b(delegate)\\b\\s*", + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(\\(.*?\\))\\s*\n(=>)", "beginCaptures": { "1": { - "patterns": [ - { - "match": "async|static", - "name": "storage.modifier.$0.cs" - } - ] + "name": "storage.modifier.cs" }, "2": { - "name": "storage.type.delegate.cs" - } - }, - "end": "(?<=})|(?=[,;)}])", - "patterns": [ - { - "include": "#intrusive" - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.parenthesis.open.cs" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.parenthesis.close.cs" - } - }, "patterns": [ { - "include": "#intrusive" - }, - { - "include": "#explicit-anonymous-function-parameter" - }, - { - "include": "#punctuation-comma" + "include": "#lambda-parameter-list" } ] }, + "3": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=\\)|;|}|,)", + "patterns": [ + { + "include": "#block" + }, + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + { + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(?:\\b(delegate)\\b\\s*)", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "name": "keyword.other.delegate.cs" + } + }, + "end": "(?=\\)|;|}|,)", + "patterns": [ + { + "include": "#parenthesized-parameter-list" + }, { "include": "#block" + }, + { + "include": "#expression" } ] } ] }, - "explicit-anonymous-function-parameter": { - "match": "(?x)\n(?:\\b(ref|params|out|in)\\b\\s*)?\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?<(?:[^<>]|\\g)*>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^()]|\\g)*\\))\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(\\g)\\b", + "lambda-parameter-list": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#lambda-parameter" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "lambda-parameter": { + "match": "(?x)\n(?:\\b(ref|out|in)\\b)?\\s*\n(?:(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\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)\\b\\s*\n(?=[,)])", "captures": { "1": { - "name": "storage.modifier.$1.cs" + "name": "storage.modifier.cs" }, "2": { "patterns": [ @@ -4945,25 +4304,8 @@ } } }, - "implicit-anonymous-function-parameter": { - "match": "\\@?[_[:alpha:]][_[:alnum:]]*\\b", - "name": "entity.name.variable.parameter.cs" - }, - "default-argument": { - "begin": "=", - "beginCaptures": { - "0": { - "name": "keyword.operator.assignment.cs" - } - }, - "end": "(?=,|\\))", - "patterns": [ - { - "include": "#expression" - } - ] - }, "type": { + "name": "meta.type.cs", "patterns": [ { "include": "#comment" @@ -4991,19 +4333,16 @@ }, { "include": "#type-nullable-suffix" - }, - { - "include": "#type-pointer-suffix" } ] }, "ref-modifier": { - "name": "storage.modifier.ref.cs", - "match": "\\bref\\b" + "name": "storage.modifier.cs", + "match": "\\b(ref)\\b" }, "readonly-modifier": { - "name": "storage.modifier.readonly.cs", - "match": "\\breadonly\\b" + "name": "storage.modifier.cs", + "match": "\\b(readonly)\\b" }, "tuple-type": { "begin": "\\(", @@ -5043,10 +4382,10 @@ } }, "type-builtin": { - "match": "\\b(bool|s?byte|u?short|n?u?int|u?long|float|double|decimal|char|string|object|void|dynamic)\\b", + "match": "\\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|dynamic)\\b", "captures": { "1": { - "name": "keyword.type.$1.cs" + "name": "keyword.type.cs" } } }, @@ -5105,6 +4444,9 @@ } }, "patterns": [ + { + "include": "#comment" + }, { "include": "#type" }, @@ -5127,9 +4469,6 @@ } }, "patterns": [ - { - "include": "#intrusive" - }, { "include": "#punctuation-comma" } @@ -5137,11 +4476,11 @@ }, "type-nullable-suffix": { "match": "\\?", - "name": "punctuation.separator.question-mark.cs" - }, - "type-pointer-suffix": { - "match": "\\*", - "name": "punctuation.separator.asterisk.cs" + "captures": { + "0": { + "name": "punctuation.separator.question-mark.cs" + } + } }, "operator-assignment": { "name": "keyword.operator.assignment.cs", @@ -5159,16 +4498,6 @@ "name": "punctuation.accessor.cs", "match": "\\." }, - "intrusive": { - "patterns": [ - { - "include": "#preprocessor" - }, - { - "include": "#comment" - } - ] - }, "preprocessor": { "name": "meta.preprocessor.cs", "begin": "^\\s*(\\#)\\s*", @@ -5474,47 +4803,38 @@ "comment": { "patterns": [ { - "name": "comment.block.documentation.cs", - "begin": "(^\\s+)?(///)(?!/)", - "while": "^(\\s*)(///)(?!/)", - "captures": { - "1": { - "name": "punctuation.whitespace.comment.leading.cs" - }, - "2": { + "name": "comment.block.cs", + "begin": "/\\*", + "beginCaptures": { + "0": { "name": "punctuation.definition.comment.cs" } }, - "patterns": [ - { - "include": "#xml-doc-comment" + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.cs" } - ] + } }, { - "name": "comment.block.documentation.cs", - "begin": "(^\\s+)?(/\\*\\*)(?!/)", - "end": "(^\\s+)?(\\*/)", - "captures": { + "begin": "(^\\s+)?(?=//)", + "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.cs" - }, - "2": { - "name": "punctuation.definition.comment.cs" } }, + "end": "(?=$)", "patterns": [ { - "begin": "\\G(?=(?~\\*/)$)", - "while": "^(\\s*+)(\\*(?!/))?(?=(?~\\*/)$)", - "whileCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.cs" - }, - "2": { + "name": "comment.block.documentation.cs", + "begin": "(?