// This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at // // and licensed `mit`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' */ /** @type {Grammar} */ const grammar = { extensions: ['.bf', '.cake', '.cs', '.cs.pp', '.csx', '.eq', '.linq', '.uno'], names: ['beef', 'c#', 'cake', 'cakescript', 'csharp', 'eq', 'uno'], patterns: [ {include: '#preprocessor'}, {include: '#comment'}, {include: '#directives'}, {include: '#declarations'}, {include: '#script-top-level'} ], repository: { 'accessor-getter': { patterns: [ { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, contentName: 'meta.accessor.getter.cs', end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#statement'}] }, {include: '#accessor-getter-expression'}, {include: '#punctuation-semicolon'} ] }, 'accessor-getter-expression': { begin: '=>', beginCaptures: {0: {name: 'keyword.operator.arrow.cs'}}, contentName: 'meta.accessor.getter.cs', end: '(?=;|\\})', patterns: [{include: '#ref-modifier'}, {include: '#expression'}] }, 'accessor-setter': { patterns: [ { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, contentName: 'meta.accessor.setter.cs', end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#statement'}] }, { begin: '=>', beginCaptures: {0: {name: 'keyword.operator.arrow.cs'}}, contentName: 'meta.accessor.setter.cs', end: '(?=;|\\})', patterns: [{include: '#ref-modifier'}, {include: '#expression'}] }, {include: '#punctuation-semicolon'} ] }, 'anonymous-method-expression': { patterns: [ { begin: '(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\b|\n (\\()\n (?(?:[^()]|\\(\\g\\))*)\n (\\))\n)\\s*\n(=>)', beginCaptures: { 1: { patterns: [ {match: 'async|static', name: 'storage.modifier.$0.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: '(?=[,;)}])', patterns: [ {include: '#intrusive'}, { begin: '(?={)', end: '(?=[,;)}])', patterns: [{include: '#block'}, {include: '#intrusive'}] }, { begin: '\\b(ref)\\b|(?=\\S)', beginCaptures: {1: {name: 'storage.modifier.ref.cs'}}, end: '(?=[,;)}])', patterns: [{include: '#expression'}] } ] }, { begin: '(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n\\b(delegate)\\b\\s*', beginCaptures: { 1: { patterns: [ {match: 'async|static', name: 'storage.modifier.$0.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: '#block'} ] } ] }, 'anonymous-object-creation-expression': { begin: '\\b(new)\\b\\s*(?=\\{|//|/\\*|$)', beginCaptures: {1: {name: 'keyword.operator.expression.new.cs'}}, end: '(?<=\\})', patterns: [{include: '#comment'}, {include: '#initializer-expression'}] }, argument: { patterns: [ {match: '\\b(ref|in)\\b', name: 'storage.modifier.$1.cs'}, { begin: '\\b(out)\\b', beginCaptures: {1: {name: 'storage.modifier.out.cs'}}, end: '(?=,|\\)|\\])', patterns: [ {include: '#declaration-expression-local'}, {include: '#expression'} ] }, {include: '#expression'} ] }, 'argument-list': { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ {include: '#named-argument'}, {include: '#argument'}, {include: '#punctuation-comma'} ] }, 'array-creation-expression': { 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*)* # pointer suffix?\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'}, 2: {patterns: [{include: '#type'}]} }, end: '(?<=\\])', patterns: [{include: '#bracketed-argument-list'}] }, 'as-expression': { captures: { 1: {name: 'keyword.operator.expression.as.cs'}, 2: {patterns: [{include: '#type'}]} }, 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*\\?(?!\\?))? # 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)?' }, 'assignment-expression': { begin: '(?:\\*|/|%|\\+|-|\\?\\?|\\&|\\^|<<|>>>?|\\|)?=(?!=|>)', beginCaptures: {0: {patterns: [{include: '#assignment-operators'}]}}, end: '(?=[,\\)\\];}])', patterns: [{include: '#ref-modifier'}, {include: '#expression'}] }, 'assignment-operators': { patterns: [ { match: '\\*=|/=|%=|\\+=|-=|\\?\\?=', name: 'keyword.operator.assignment.compound.cs' }, { match: '\\&=|\\^=|<<=|>>>?=|\\|=', name: 'keyword.operator.assignment.compound.bitwise.cs' }, {match: '\\=', name: 'keyword.operator.assignment.cs'} ] }, attribute: { patterns: [ {include: '#type-name'}, {include: '#type-arguments'}, {include: '#attribute-arguments'} ] }, 'attribute-arguments': { begin: '(\\()', beginCaptures: {1: {name: 'punctuation.parenthesis.open.cs'}}, end: '(\\))', endCaptures: {1: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ {include: '#attribute-named-argument'}, {include: '#expression'}, {include: '#punctuation-comma'} ] }, 'attribute-named-argument': { begin: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?==)', beginCaptures: {1: {name: 'entity.name.variable.property.cs'}}, end: '(?=(,|\\)))', patterns: [{include: '#operator-assignment'}, {include: '#expression'}] }, 'attribute-section': { begin: '(\\[)(assembly|module|field|event|method|param|property|return|typevar|type)?(\\:)?', beginCaptures: { 1: {name: 'punctuation.squarebracket.open.cs'}, 2: {name: 'keyword.other.attribute-specifier.cs'}, 3: {name: 'punctuation.separator.colon.cs'} }, end: '(\\])', endCaptures: {1: {name: 'punctuation.squarebracket.close.cs'}}, patterns: [ {include: '#comment'}, {include: '#attribute'}, {include: '#punctuation-comma'} ] }, 'await-expression': {name: 'keyword.operator.expression.await.cs'}, 'await-statement': { beginCaptures: {1: {name: 'keyword.operator.expression.await.cs'}}, end: '(?<=})|(?=;|})', patterns: [ {include: '#foreach-statement'}, {include: '#using-statement'}, {include: '#expression'} ] }, 'base-class-constructor-call': { begin: '(?x)\n(?:\n (@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.) # qualified name part\n)*\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # type name\n(\n <\n (?\n [^<>()]|\n \\((?:[^<>()]|<[^<>()]*>|\\([^<>()]*\\))*\\)|\n <\\g*>\n )*\n >\\s*\n)? # optional type arguments\n(?=\\() # followed by argument list', beginCaptures: { 1: {name: 'entity.name.type.cs'}, 2: {name: 'punctuation.accessor.cs'}, 3: {name: 'entity.name.type.cs'}, 4: {patterns: [{include: '#type-arguments'}]} }, end: '(?<=\\))', patterns: [{include: '#argument-list'}] }, 'base-types': { begin: ':', beginCaptures: {0: {name: 'punctuation.separator.colon.cs'}}, end: '(?=\\{|where|;)', patterns: [ {include: '#base-class-constructor-call'}, {include: '#type'}, {include: '#punctuation-comma'}, {include: '#preprocessor'} ] }, block: { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#statement'}] }, 'boolean-literal': { patterns: [ { 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(\\))(?=\\s*-*!*@?[_[:alnum:]\\(])' }, 'casted-constant-pattern': { begin: '(?x)\n(\\()\n ([\\s.:@_[:alnum:]]+)\n(\\))\n(?=[\\s+\\-!~]*@?[_[:alnum:](\'"]+)', beginCaptures: { 1: {name: 'punctuation.parenthesis.open.cs'}, 2: {patterns: [{include: '#type-builtin'}, {include: '#type-name'}]}, 3: {name: 'punctuation.parenthesis.close.cs'} }, end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ {include: '#casted-constant-pattern'}, { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#constant-pattern'}] }, {include: '#constant-pattern'}, { captures: { 1: {name: 'entity.name.type.alias.cs'}, 2: {name: 'punctuation.separator.coloncolon.cs'} }, match: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)' }, { captures: { 1: {name: 'entity.name.type.cs'}, 2: {name: 'punctuation.accessor.cs'} }, match: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)' }, { match: '\\@?[_[:alpha:]][_[:alnum:]]*', name: 'variable.other.constant.cs' } ] }, 'catch-clause': { 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)\\s*\n(?:(\\g)\\b)?' } ] }, {include: '#when-clause'}, {include: '#comment'}, {include: '#block'} ] }, 'char-character-escape': { match: '\\\\(x[0-9a-fA-F]{1,4}|u[0-9a-fA-F]{4}|.)', name: 'constant.character.escape.cs' }, 'char-literal': { begin: "'", beginCaptures: {0: {name: 'punctuation.definition.char.begin.cs'}}, end: "(\\')|((?:[^\\\\\\n])$)", endCaptures: { 1: {name: 'punctuation.definition.char.end.cs'}, 2: {name: 'invalid.illegal.newline.cs'} }, name: 'string.quoted.single.cs', patterns: [{include: '#char-character-escape'}] }, 'class-declaration': { begin: '(?=(\\brecord\\b\\s+)?\\bclass\\b)', end: '(?<=\\})|(?=;)', patterns: [ { begin: '(?x)\n(\\b(record)\\b\\s+)?\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*', beginCaptures: { 2: {name: 'storage.type.record.cs'}, 3: {name: 'storage.type.class.cs'}, 4: {name: 'entity.name.type.class.cs'} }, end: '(?=\\{)|(?=;)', patterns: [ {include: '#comment'}, {include: '#type-parameter-list'}, {include: '#parenthesized-parameter-list'}, {include: '#base-types'}, {include: '#generic-constraints'} ] }, { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#class-or-struct-members'}] }, {include: '#preprocessor'}, {include: '#comment'} ] }, 'class-or-struct-members': { patterns: [ {include: '#preprocessor'}, {include: '#comment'}, {include: '#storage-modifier'}, {include: '#type-declarations'}, {include: '#constructor-declaration'}, {include: '#property-declaration'}, {include: '#fixed-size-buffer-declaration'}, {include: '#field-declaration'}, {include: '#event-declaration'}, {include: '#indexer-declaration'}, {include: '#variable-initializer'}, {include: '#destructor-declaration'}, {include: '#operator-declaration'}, {include: '#conversion-operator-declaration'}, {include: '#method-declaration'}, {include: '#attribute-section'}, {include: '#punctuation-semicolon'} ] }, 'combinator-pattern': { match: '\\b(and|or|not)\\b', name: 'keyword.operator.expression.pattern.combinator.$1.cs' }, comment: { patterns: [ { begin: '(^\\s+)?(///)(?!/)', captures: { 1: {name: 'punctuation.whitespace.comment.leading.cs'}, 2: {name: 'punctuation.definition.comment.cs'} }, name: 'comment.block.documentation.cs', patterns: [{include: '#xml-doc-comment'}], while: '^(\\s*)(///)(?!/)' }, { begin: '(^\\s+)?(/\\*\\*)(?!/)', captures: { 1: {name: 'punctuation.whitespace.comment.leading.cs'}, 2: {name: 'punctuation.definition.comment.cs'} }, end: '(^\\s+)?(\\*/)', name: 'comment.block.documentation.cs', patterns: [ { patterns: [{include: '#xml-doc-comment'}], whileCaptures: { 1: {name: 'punctuation.whitespace.comment.leading.cs'}, 2: {name: 'punctuation.definition.comment.cs'} } }, {include: '#xml-doc-comment'} ] }, { begin: '(^\\s+)?(//).*$', captures: { 1: {name: 'punctuation.whitespace.comment.leading.cs'}, 2: {name: 'punctuation.definition.comment.cs'} }, name: 'comment.line.double-slash.cs', while: '^(\\s*)(//).*$' }, { begin: '/\\*', captures: {0: {name: 'punctuation.definition.comment.cs'}}, end: '\\*/', name: 'comment.block.cs' } ] }, 'conditional-operator': { patterns: [ { match: '\\?(?!\\?|\\s*[.\\[])', name: 'keyword.operator.conditional.question-mark.cs' }, {match: ':', name: 'keyword.operator.conditional.colon.cs'} ] }, 'constant-pattern': { patterns: [ {include: '#boolean-literal'}, {include: '#null-literal'}, {include: '#numeric-literal'}, {include: '#char-literal'}, {include: '#string-literal'}, {include: '#raw-string-literal'}, {include: '#verbatim-string-literal'}, {include: '#type-operator-expression'}, {include: '#expression-operator-expression'}, {include: '#expression-operators'}, {include: '#casted-constant-pattern'} ] }, 'constructor-declaration': { begin: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\(|$)', beginCaptures: {1: {name: 'entity.name.function.cs'}}, end: '(?<=\\})|(?=;)', patterns: [ { begin: '(:)', beginCaptures: {1: {name: 'punctuation.separator.colon.cs'}}, end: '(?=\\{|=>)', patterns: [{include: '#constructor-initializer'}] }, {include: '#parenthesized-parameter-list'}, {include: '#preprocessor'}, {include: '#comment'}, {include: '#expression-body'}, {include: '#block'} ] }, 'constructor-initializer': { begin: '\\b(base|this)\\b\\s*(?=\\()', beginCaptures: {1: {name: 'variable.language.$1.cs'}}, end: '(?<=\\))', patterns: [{include: '#argument-list'}] }, 'context-control-paren-statement': { patterns: [ {include: '#fixed-statement'}, {include: '#lock-statement'}, {include: '#using-statement'} ] }, 'context-control-statement': { match: '\\b(checked|unchecked|unsafe)\\b(?!\\s*[@_[:alpha:](])', name: 'keyword.control.context.$1.cs' }, 'conversion-operator-declaration': { begin: '(?x)\n(?(?:\\b(?:explicit|implicit)))\\s*\n(?(?:\\b(?:operator)))\\s*\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(?=\\()', beginCaptures: { 1: { patterns: [ { captures: {1: {name: 'storage.modifier.explicit.cs'}}, match: '\\b(explicit)\\b' }, { captures: {1: {name: 'storage.modifier.implicit.cs'}}, match: '\\b(implicit)\\b' } ] }, 2: {name: 'storage.type.operator.cs'}, 3: {patterns: [{include: '#type'}]} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#parenthesized-parameter-list'}, {include: '#expression-body'}, {include: '#block'} ] }, 'declaration-expression-local': { captures: { 1: {name: 'storage.type.var.cs'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.local.cs'} }, 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(?=[,)\\]])' }, 'declaration-expression-tuple': { captures: { 1: {name: 'storage.type.var.cs'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.tuple-element.cs'} }, 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(?=[,)])' }, declarations: { patterns: [ {include: '#namespace-declaration'}, {include: '#type-declarations'}, {include: '#punctuation-semicolon'} ] }, 'default-argument': { begin: '=', beginCaptures: {0: {name: 'keyword.operator.assignment.cs'}}, end: '(?=,|\\))', patterns: [{include: '#expression'}] }, 'default-literal-expression': { captures: {1: {name: 'keyword.operator.expression.default.cs'}}, match: '\\b(default)\\b' }, 'delegate-declaration': { begin: '(?x)\n(?:\\b(delegate)\\b)\\s+\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(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()', beginCaptures: { 1: {name: 'storage.type.delegate.cs'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.type.delegate.cs'}, 8: {patterns: [{include: '#type-parameter-list'}]} }, end: '(?=;)', patterns: [ {include: '#comment'}, {include: '#parenthesized-parameter-list'}, {include: '#generic-constraints'} ] }, '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'} ] }, 'destructor-declaration': { begin: '(~)(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\()', beginCaptures: { 1: {name: 'punctuation.tilde.cs'}, 2: {name: 'entity.name.function.cs'} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#parenthesized-parameter-list'}, {include: '#expression-body'}, {include: '#block'} ] }, directives: { patterns: [ {include: '#extern-alias-directive'}, {include: '#using-directive'}, {include: '#attribute-section'}, {include: '#punctuation-semicolon'} ] }, 'discard-pattern': { match: '_(?![_[:alnum:]])', name: 'variable.language.discard.cs' }, 'do-statement': { begin: '(?)\\s* # preceding pointer arrow?\n)?\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'}, 2: {name: 'punctuation.accessor.cs'}, 3: {name: 'punctuation.accessor.pointer.cs'}, 4: {name: 'variable.other.object.property.cs'}, 5: {name: 'keyword.operator.null-conditional.cs'} }, end: '(?<=\\])(?!\\s*\\[)', patterns: [{include: '#bracketed-argument-list'}] }, 'else-part': { begin: '(?|//|/\\*|$)', beginCaptures: {1: {name: 'storage.type.accessor.$1.cs'}}, end: '(?<=\\}|;)|(?=\\})', patterns: [{include: '#accessor-setter'}] } ] }, '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(?=\\{|;|,|=|//|/\\*|$)', beginCaptures: { 1: {name: 'storage.type.event.cs'}, 2: {patterns: [{include: '#type'}]}, 8: {patterns: [{include: '#type'}, {include: '#punctuation-accessor'}]}, 9: {name: 'entity.name.variable.event.cs'} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#event-accessors'}, { match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.variable.event.cs' }, {include: '#punctuation-comma'}, { begin: '=', beginCaptures: {0: {name: 'keyword.operator.assignment.cs'}}, end: '(?<=,)|(?=;)', patterns: [{include: '#expression'}, {include: '#punctuation-comma'}] } ] }, 'explicit-anonymous-function-parameter': { captures: { 1: {name: 'storage.modifier.$1.cs'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.parameter.cs'} }, 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' }, expression: { patterns: [ {include: '#preprocessor'}, {include: '#comment'}, {include: '#expression-operator-expression'}, {include: '#type-operator-expression'}, {include: '#default-literal-expression'}, {include: '#throw-expression'}, {include: '#raw-interpolated-string'}, {include: '#interpolated-string'}, {include: '#verbatim-interpolated-string'}, {include: '#type-builtin'}, {include: '#language-variable'}, {include: '#switch-statement-or-expression'}, {include: '#with-expression'}, {include: '#conditional-operator'}, {include: '#assignment-expression'}, {include: '#expression-operators'}, {include: '#await-expression'}, {include: '#query-expression'}, {include: '#as-expression'}, {include: '#is-expression'}, {include: '#boolean-literal'}, {include: '#null-literal'}, {include: '#anonymous-method-expression'}, {include: '#object-creation-expression'}, {include: '#array-creation-expression'}, {include: '#anonymous-object-creation-expression'}, {include: '#invocation-expression'}, {include: '#member-access-expression'}, {include: '#element-access-expression'}, {include: '#cast-expression'}, {include: '#literal'}, {include: '#parenthesized-expression'}, {include: '#tuple-deconstruction-assignment'}, {include: '#initializer-expression'}, {include: '#identifier'} ] }, 'expression-body': { begin: '=>', beginCaptures: {0: {name: 'keyword.operator.arrow.cs'}}, end: '(?=[,\\);}])', patterns: [{include: '#ref-modifier'}, {include: '#expression'}] }, 'expression-operator-expression': { begin: '\\b(checked|unchecked|nameof)\\s*(\\()', beginCaptures: { 1: {name: 'keyword.operator.expression.$1.cs'}, 2: {name: 'punctuation.parenthesis.open.cs'} }, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#expression'}] }, 'expression-operators': { patterns: [ {match: '<<|>>>?', name: 'keyword.operator.bitwise.shift.cs'}, {match: '==|!=', name: 'keyword.operator.comparison.cs'}, {match: '<=|>=|<|>', name: 'keyword.operator.relational.cs'}, {match: '\\!|&&|\\|\\|', name: 'keyword.operator.logical.cs'}, {match: '\\&|~|\\^|\\|', name: 'keyword.operator.bitwise.cs'}, {match: '--', name: 'keyword.operator.decrement.cs'}, {match: '\\+\\+', name: 'keyword.operator.increment.cs'}, {match: '\\+|-(?!>)|\\*|/|%', name: 'keyword.operator.arithmetic.cs'}, {match: '\\?\\?', name: 'keyword.operator.null-coalescing.cs'}, {match: '\\.\\.', name: 'keyword.operator.range.cs'} ] }, 'extern-alias-directive': { begin: '\\b(extern)\\s+(alias)\\b', beginCaptures: { 1: {name: 'keyword.other.directive.extern.cs'}, 2: {name: 'keyword.other.directive.alias.cs'} }, end: '(?=;)', patterns: [ { match: '\\@?[_[:alpha:]][_[:alnum:]]*', name: 'variable.other.alias.cs' } ] }, 'field-declaration': { begin: '(?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(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)', beginCaptures: { 1: {patterns: [{include: '#type'}]}, 6: {name: 'entity.name.variable.field.cs'} }, end: '(?=;)', patterns: [ { match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.variable.field.cs' }, {include: '#punctuation-comma'}, {include: '#comment'}, {include: '#variable-initializer'}, {include: '#class-or-struct-members'} ] }, 'finally-clause': { begin: '(?\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 )\n)\\s+\n(\\g)\\s* # buffer name\n(?=\\[)', beginCaptures: { 1: {name: 'storage.modifier.fixed.cs'}, 2: {patterns: [{include: '#type'}]}, 6: {name: 'entity.name.variable.field.cs'} }, end: '(?=;)', patterns: [{include: '#bracketed-argument-list'}, {include: '#comment'}] }, 'fixed-statement': { begin: '\\b(fixed)\\b', beginCaptures: {1: {name: 'keyword.control.context.fixed.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: '#local-variable-declaration'} ] } ] }, 'for-statement': { begin: '\\b(for)\\b', beginCaptures: {1: {name: 'keyword.control.loop.for.cs'}}, end: '(?<=\\))|(?=;|})', patterns: [ { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ { begin: '(?=[^;\\)])', end: '(?=;|\\))', patterns: [ {include: '#intrusive'}, {include: '#local-variable-declaration'}, {include: '#local-tuple-var-deconstruction'}, {include: '#tuple-deconstruction-assignment'}, {include: '#expression'} ] }, { begin: '(?=;)', end: '(?=\\))', patterns: [ {include: '#intrusive'}, {include: '#expression'}, {include: '#punctuation-comma'}, {include: '#punctuation-semicolon'} ] } ] } ] }, 'foreach-statement': { begin: '\\b(foreach)\\b', beginCaptures: {1: {name: 'keyword.control.loop.foreach.cs'}}, end: '(?<=\\))|(?=;|})', patterns: [ {include: '#intrusive'}, { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ {include: '#intrusive'}, { captures: { 1: {name: 'storage.modifier.ref.cs'}, 2: {name: 'storage.type.var.cs'}, 3: {patterns: [{include: '#type'}]}, 8: {name: 'entity.name.variable.local.cs'}, 9: {name: 'keyword.control.loop.in.cs'} }, match: '(?x)\n(?:\n (?:(\\bref)\\s+)?(\\bvar\\b)| # ref local\n (?\n (?:\n (?:ref\\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\\b(in)\\b' }, { captures: { 1: {name: 'storage.type.var.cs'}, 2: { patterns: [ {include: '#tuple-declaration-deconstruction-element-list'} ] }, 3: {name: 'keyword.control.loop.in.cs'} }, match: '(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s+\n\\b(in)\\b' }, {include: '#expression'} ] } ] }, 'generic-constraints': { begin: '(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)', beginCaptures: { 1: {name: 'storage.modifier.where.cs'}, 2: {name: 'entity.name.type.type-parameter.cs'}, 3: {name: 'punctuation.separator.colon.cs'} }, end: '(?=\\{|where|;|=>)', patterns: [ {match: '\\bclass\\b', name: 'storage.type.class.cs'}, {match: '\\bstruct\\b', name: 'storage.type.struct.cs'}, {match: '\\bdefault\\b', name: 'keyword.other.constraint.default.cs'}, {match: '\\bnotnull\\b', name: 'keyword.other.constraint.notnull.cs'}, { match: '\\bunmanaged\\b', name: 'keyword.other.constraint.unmanaged.cs' }, { captures: { 1: {name: 'keyword.operator.expression.new.cs'}, 2: {name: 'punctuation.parenthesis.open.cs'}, 3: {name: 'punctuation.parenthesis.close.cs'} }, match: '(new)\\s*(\\()\\s*(\\))' }, {include: '#type'}, {include: '#punctuation-comma'}, {include: '#generic-constraints'} ] }, 'goto-statement': { begin: '(?\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(?this)\\s*\n(?=\\[)', beginCaptures: { 1: {patterns: [{include: '#type'}]}, 7: {patterns: [{include: '#type'}, {include: '#punctuation-accessor'}]}, 8: {name: 'variable.language.this.cs'} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#bracketed-parameter-list'}, {include: '#property-accessors'}, {include: '#accessor-getter-expression'}, {include: '#variable-initializer'} ] }, 'initializer-expression': { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#expression'}, {include: '#punctuation-comma'}] }, 'interface-declaration': { begin: '(?=\\binterface\\b)', end: '(?<=\\})|(?=;)', patterns: [ { begin: '(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)', beginCaptures: { 1: {name: 'storage.type.interface.cs'}, 2: {name: 'entity.name.type.interface.cs'} }, end: '(?=\\{)|(?=;)', patterns: [ {include: '#comment'}, {include: '#type-parameter-list'}, {include: '#base-types'}, {include: '#generic-constraints'} ] }, { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#interface-members'}] }, {include: '#preprocessor'}, {include: '#comment'} ] }, 'interface-members': { patterns: [ {include: '#preprocessor'}, {include: '#comment'}, {include: '#storage-modifier'}, {include: '#property-declaration'}, {include: '#event-declaration'}, {include: '#indexer-declaration'}, {include: '#method-declaration'}, {include: '#operator-declaration'}, {include: '#attribute-section'}, {include: '#punctuation-semicolon'} ] }, 'interpolated-string': { begin: '\\$"', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '(")|((?:[^\\\\\\n])$)', endCaptures: { 1: {name: 'punctuation.definition.string.end.cs'}, 2: {name: 'invalid.illegal.newline.cs'} }, name: 'string.quoted.double.cs', patterns: [ {include: '#string-character-escape'}, {include: '#interpolation'} ] }, interpolation: { begin: '(?<=[^\\{]|^)((?:\\{\\{)*)(\\{)(?=[^\\{])', beginCaptures: { 1: {name: 'string.quoted.double.cs'}, 2: {name: 'punctuation.definition.interpolation.begin.cs'} }, end: '\\}', endCaptures: {0: {name: 'punctuation.definition.interpolation.end.cs'}}, name: 'meta.embedded.interpolation.cs', patterns: [{include: '#expression'}] }, intrusive: {patterns: [{include: '#preprocessor'}, {include: '#comment'}]}, '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 \\((?:[^<>()]|<[^<>()]*>|\\([^<>()]*\\))*\\)|\n <\\g*>\n )*\n >\\s*\n)? # type arguments\n(?=\\() # open paren of argument list', beginCaptures: { 1: {name: 'keyword.operator.null-conditional.cs'}, 2: {name: 'punctuation.accessor.cs'}, 3: {name: 'punctuation.accessor.pointer.cs'}, 4: {name: 'entity.name.function.cs'}, 5: {patterns: [{include: '#type-arguments'}]} }, end: '(?<=\\))', patterns: [{include: '#argument-list'}] }, 'is-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*\\?\\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'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.range-variable.cs'}, 8: {name: 'keyword.operator.expression.query.in.cs'} }, end: '(?=;|\\))', patterns: [ {include: '#join-on'}, {include: '#join-equals'}, {include: '#join-into'}, {include: '#query-body'}, {include: '#expression'} ] }, 'join-equals': { captures: {1: {name: 'keyword.operator.expression.query.equals.cs'}}, match: '\\b(equals)\\b\\s*' }, 'join-into': { captures: { 1: {name: 'keyword.operator.expression.query.into.cs'}, 2: {name: 'entity.name.variable.range-variable.cs'} }, match: '(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*' }, 'join-on': { captures: {1: {name: 'keyword.operator.expression.query.on.cs'}}, match: '\\b(on)\\b\\s*' }, 'labeled-statement': { captures: { 1: {name: 'entity.name.label.cs'}, 2: {name: 'punctuation.separator.colon.cs'} }, match: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)' }, 'language-variable': { patterns: [ {match: '\\b(base|this)\\b', name: 'variable.language.$1.cs'}, {match: '\\b(value)\\b', name: 'variable.other.$1.cs'} ] }, 'let-clause': { begin: '(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*', beginCaptures: { 1: {name: 'keyword.operator.expression.query.let.cs'}, 2: {name: 'entity.name.variable.range-variable.cs'}, 3: {name: 'keyword.operator.assignment.cs'} }, end: '(?=;|\\))', patterns: [{include: '#query-body'}, {include: '#expression'}] }, 'list-pattern': { begin: '(?=\\[)', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ { begin: '\\[', beginCaptures: {0: {name: 'punctuation.squarebracket.open.cs'}}, end: '\\]', endCaptures: {0: {name: 'punctuation.squarebracket.close.cs'}}, patterns: [{include: '#pattern'}, {include: '#punctuation-comma'}] }, { begin: '(?<=\\])', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ {include: '#intrusive'}, {include: '#simple-designation-pattern'} ] } ] }, literal: { patterns: [ {include: '#boolean-literal'}, {include: '#null-literal'}, {include: '#numeric-literal'}, {include: '#char-literal'}, {include: '#raw-string-literal'}, {include: '#string-literal'}, {include: '#verbatim-string-literal'}, {include: '#tuple-literal'} ] }, 'local-constant-declaration': { 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'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.local.cs'} }, end: '(?=;)', patterns: [ { match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.variable.local.cs' }, {include: '#punctuation-comma'}, {include: '#comment'}, {include: '#variable-initializer'} ] }, 'local-declaration': { patterns: [ {include: '#local-constant-declaration'}, {include: '#local-variable-declaration'}, {include: '#local-function-declaration'}, {include: '#local-tuple-var-deconstruction'}, {include: '#local-tuple-declaration-deconstruction'} ] }, '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'} ] }, 'local-tuple-declaration-deconstruction': { captures: { 1: { patterns: [ {include: '#tuple-declaration-deconstruction-element-list'} ] } }, match: '(?x) # e.g. (int x, var y) = GetPoint();\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)' }, 'local-tuple-var-deconstruction': { begin: '(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?=;|=|\\))', beginCaptures: { 1: {name: 'storage.type.var.cs'}, 2: { patterns: [ {include: '#tuple-declaration-deconstruction-element-list'} ] } }, end: '(?=;|\\))', patterns: [{include: '#comment'}, {include: '#variable-initializer'}] }, 'local-variable-declaration': { begin: '(?x)\n(?:\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*)* # pointer suffix?\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'}, 2: {name: 'storage.modifier.readonly.cs'}, 3: {name: 'storage.type.var.cs'}, 4: {patterns: [{include: '#type'}]}, 9: {name: 'entity.name.variable.local.cs'} }, end: '(?=[;)}])', patterns: [ { match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.variable.local.cs' }, {include: '#punctuation-comma'}, {include: '#comment'}, {include: '#variable-initializer'} ] }, 'lock-statement': { begin: '\\b(lock)\\b', beginCaptures: {1: {name: 'keyword.control.context.lock.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: '#expression'}] } ] }, 'member-access-expression': { patterns: [ { captures: { 1: {name: 'keyword.operator.null-conditional.cs'}, 2: {name: 'punctuation.accessor.cs'}, 3: {name: 'punctuation.accessor.pointer.cs'}, 4: {name: 'variable.other.object.property.cs'} }, 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 ?[' }, { captures: { 1: {name: 'punctuation.accessor.cs'}, 2: {name: 'variable.other.object.cs'}, 3: {patterns: [{include: '#type-arguments'}]} }, match: '(?x)\n(\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?\\s*<([^<>]|\\g)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)' }, { captures: {1: {name: 'variable.other.object.cs'}}, match: '(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n \\s*(?:(?:\\?\\s*)?\\.|->)\n \\s*@?[_[:alpha:]][_[:alnum:]]*\n)' } ] }, 'method-declaration': { begin: '(?x)\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(<([^<>]+)>)?\\s*\n(?=\\()', beginCaptures: { 1: {patterns: [{include: '#type'}]}, 7: {patterns: [{include: '#type'}, {include: '#punctuation-accessor'}]}, 8: {name: 'entity.name.function.cs'}, 9: {patterns: [{include: '#type-parameter-list'}]} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#parenthesized-parameter-list'}, {include: '#generic-constraints'}, {include: '#expression-body'}, {include: '#block'} ] }, 'named-argument': { begin: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)', beginCaptures: { 1: {name: 'entity.name.variable.parameter.cs'}, 2: {name: 'punctuation.separator.colon.cs'} }, end: '(?=(,|\\)|\\]))', patterns: [{include: '#argument'}] }, 'namespace-declaration': { begin: '\\b(namespace)\\s+', beginCaptures: {1: {name: 'storage.type.namespace.cs'}}, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, { match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.type.namespace.cs' }, {include: '#punctuation-accessor'}, { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [ {include: '#declarations'}, {include: '#using-directive'}, {include: '#punctuation-semicolon'} ] } ] }, 'null-literal': { 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(?=\\{|//|/\\*|$)' }, 'object-creation-expression-with-parameters': { 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'}, 2: {patterns: [{include: '#type'}]} }, end: '(?<=\\))', patterns: [{include: '#argument-list'}] }, 'operator-assignment': { 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\\b(?operator)\\b\\s*\n(?[+\\-*/%&|\\^!=~<>]+|true|false)\\s*\n(?=\\()', beginCaptures: { 1: {patterns: [{include: '#type'}]}, 6: {name: 'storage.type.operator.cs'}, 7: {name: 'entity.name.function.cs'} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#parenthesized-parameter-list'}, {include: '#expression-body'}, {include: '#block'} ] }, 'orderby-clause': { begin: '\\b(orderby)\\b\\s*', beginCaptures: { 1: {name: 'keyword.operator.expression.query.orderby.cs'} }, end: '(?=;|\\))', patterns: [ {include: '#ordering-direction'}, {include: '#query-body'}, {include: '#expression'}, {include: '#punctuation-comma'} ] }, 'ordering-direction': { captures: {1: {name: 'keyword.operator.expression.query.$1.cs'}}, match: '\\b(ascending|descending)\\b' }, parameter: { captures: { 1: {name: 'storage.modifier.$1.cs'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.parameter.cs'} }, 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)' }, 'parenthesized-expression': { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#expression'}] }, 'parenthesized-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: '#parameter'}, {include: '#punctuation-comma'}, {include: '#variable-initializer'} ] }, pattern: { patterns: [ {include: '#intrusive'}, {include: '#combinator-pattern'}, {include: '#discard-pattern'}, {include: '#constant-pattern'}, {include: '#relational-pattern'}, {include: '#var-pattern'}, {include: '#type-pattern'}, {include: '#positional-pattern'}, {include: '#property-pattern'}, {include: '#list-pattern'}, {include: '#slice-pattern'} ] }, 'positional-pattern': { begin: '(?=\\()', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#subpattern'}, {include: '#punctuation-comma'}] }, { begin: '(?<=\\))', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ {include: '#intrusive'}, {include: '#property-pattern'}, {include: '#simple-designation-pattern'} ] } ] }, preprocessor: { begin: '^\\s*(\\#)\\s*', beginCaptures: {1: {name: 'punctuation.separator.hash.cs'}}, end: '(?<=$)', name: 'meta.preprocessor.cs', patterns: [ {include: '#preprocessor-comment'}, {include: '#preprocessor-define-or-undef'}, {include: '#preprocessor-if-or-elif'}, {include: '#preprocessor-else-or-endif'}, {include: '#preprocessor-warning-or-error'}, {include: '#preprocessor-region'}, {include: '#preprocessor-endregion'}, {include: '#preprocessor-load'}, {include: '#preprocessor-r'}, {include: '#preprocessor-line'}, {include: '#preprocessor-pragma-warning'}, {include: '#preprocessor-pragma-checksum'}, {include: '#preprocessor-app-directive'} ] }, 'preprocessor-app-directive': { begin: '\\s*(:)\\s*', beginCaptures: {1: {name: 'punctuation.separator.colon.cs'}}, end: '(?=$)', patterns: [ {include: '#preprocessor-app-directive-package'}, {include: '#preprocessor-app-directive-property'}, {include: '#preprocessor-app-directive-project'}, {include: '#preprocessor-app-directive-sdk'}, {include: '#preprocessor-app-directive-generic'} ] }, 'preprocessor-app-directive-generic': { captures: {1: {name: 'string.unquoted.preprocessor.message.cs'}}, match: '\\b(.*)?\\s*' }, 'preprocessor-app-directive-package': { captures: { 1: {name: 'keyword.preprocessor.package.cs'}, 2: {patterns: [{include: '#preprocessor-app-directive-package-name'}]}, 3: {name: 'punctuation.separator.at.cs'}, 4: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(package)\\b\\s*([_[:alpha:]][_.[:alnum:]]*)?(@)?(.*)?\\s*' }, 'preprocessor-app-directive-package-name': { patterns: [ { captures: { 1: {name: 'punctuation.dot.cs'}, 2: {name: 'entity.name.variable.preprocessor.symbol.cs'} }, match: '(\\.)([_[:alpha:]][_[:alnum:]]*)' }, { match: '[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.variable.preprocessor.symbol.cs' } ] }, 'preprocessor-app-directive-project': { captures: { 1: {name: 'keyword.preprocessor.project.cs'}, 2: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(project)\\b\\s*(.*)?\\s*' }, 'preprocessor-app-directive-property': { captures: { 1: {name: 'keyword.preprocessor.property.cs'}, 2: {name: 'entity.name.variable.preprocessor.symbol.cs'}, 3: {name: 'punctuation.separator.equals.cs'}, 4: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(property)\\b\\s*([_[:alpha:]][_[:alnum:]]*)?(=)?(.*)?\\s*' }, 'preprocessor-app-directive-sdk': { captures: { 1: {name: 'keyword.preprocessor.sdk.cs'}, 2: {patterns: [{include: '#preprocessor-app-directive-package-name'}]}, 3: {name: 'punctuation.separator.at.cs'}, 4: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(sdk)\\b\\s*([_[:alpha:]][_.[:alnum:]]*)?(@)?(.*)?\\s*' }, 'preprocessor-comment': { patterns: [ { captures: {1: {name: 'punctuation.definition.comment.cs'}}, match: '(//).*(?=$)', name: 'comment.line.double-slash.cs' }, { begin: '/\\*', captures: {0: {name: 'punctuation.definition.comment.cs'}}, end: '\\*/', name: 'comment.block.cs' } ] }, 'preprocessor-define-or-undef': { captures: { 1: {name: 'keyword.preprocessor.define.cs'}, 2: {name: 'keyword.preprocessor.undef.cs'}, 3: {name: 'entity.name.variable.preprocessor.symbol.cs'} }, match: '\\b(?:(define)|(undef))\\b\\s*\\b([_[:alpha:]][_[:alnum:]]*)\\b' }, 'preprocessor-else-or-endif': { captures: { 1: {name: 'keyword.preprocessor.else.cs'}, 2: {name: 'keyword.preprocessor.endif.cs'} }, match: '\\b(?:(else)|(endif))\\b' }, 'preprocessor-endregion': { captures: {1: {name: 'keyword.preprocessor.endregion.cs'}}, match: '\\b(endregion)\\b' }, 'preprocessor-expression': { patterns: [ { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#preprocessor-expression'}] }, { captures: { 1: {name: 'constant.language.boolean.true.cs'}, 2: {name: 'constant.language.boolean.false.cs'}, 3: {name: 'entity.name.variable.preprocessor.symbol.cs'} }, match: '\\b(?:(true)|(false)|([_[:alpha:]][_[:alnum:]]*))\\b' }, { captures: { 1: {name: 'keyword.operator.comparison.cs'}, 2: {name: 'keyword.operator.logical.cs'} }, match: '(==|!=)|(\\!|&&|\\|\\|)' } ] }, 'preprocessor-if-or-elif': { begin: '\\b(?:(if)|(elif))\\b', beginCaptures: { 1: {name: 'keyword.preprocessor.if.cs'}, 2: {name: 'keyword.preprocessor.elif.cs'} }, end: '(?=$)', patterns: [ {include: '#preprocessor-comment'}, {include: '#preprocessor-expression'} ] }, 'preprocessor-line': { begin: '\\b(line)\\b', beginCaptures: {1: {name: 'keyword.preprocessor.line.cs'}}, end: '(?=$)', patterns: [ { captures: { 1: {name: 'keyword.preprocessor.default.cs'}, 2: {name: 'keyword.preprocessor.hidden.cs'} }, match: '\\b(?:(default|hidden))' }, {captures: {0: {name: 'constant.numeric.decimal.cs'}}, match: '[0-9]+'}, {captures: {0: {name: 'string.quoted.double.cs'}}, match: '\\"[^"]*\\"'} ] }, 'preprocessor-load': { begin: '\\b(load)\\b', beginCaptures: {1: {name: 'keyword.preprocessor.load.cs'}}, end: '(?=$)', patterns: [ {captures: {0: {name: 'string.quoted.double.cs'}}, match: '\\"[^"]*\\"'} ] }, 'preprocessor-pragma-checksum': { captures: { 1: {name: 'keyword.preprocessor.pragma.cs'}, 2: {name: 'keyword.preprocessor.checksum.cs'}, 3: {name: 'string.quoted.double.cs'}, 4: {name: 'string.quoted.double.cs'}, 5: {name: 'string.quoted.double.cs'} }, match: '\\b(pragma)\\b\\s*\\b(checksum)\\b\\s*(\\"[^"]*\\")\\s*(\\"[^"]*\\")\\s*(\\"[^"]*\\")' }, 'preprocessor-pragma-warning': { captures: { 1: {name: 'keyword.preprocessor.pragma.cs'}, 2: {name: 'keyword.preprocessor.warning.cs'}, 3: {name: 'keyword.preprocessor.disable.cs'}, 4: {name: 'keyword.preprocessor.restore.cs'}, 5: { patterns: [ { captures: {0: {name: 'constant.numeric.decimal.cs'}}, match: '[0-9]+' }, {include: '#punctuation-comma'} ] } }, match: '\\b(pragma)\\b\\s*\\b(warning)\\b\\s*\\b(?:(disable)|(restore))\\b(\\s*[0-9]+(?:\\s*,\\s*[0-9]+)?)?' }, 'preprocessor-r': { begin: '\\b(r)\\b', beginCaptures: {1: {name: 'keyword.preprocessor.r.cs'}}, end: '(?=$)', patterns: [ {captures: {0: {name: 'string.quoted.double.cs'}}, match: '\\"[^"]*\\"'} ] }, 'preprocessor-region': { captures: { 1: {name: 'keyword.preprocessor.region.cs'}, 2: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(region)\\b\\s*(.*)(?=$)' }, 'preprocessor-warning-or-error': { captures: { 1: {name: 'keyword.preprocessor.warning.cs'}, 2: {name: 'keyword.preprocessor.error.cs'}, 3: {name: 'string.unquoted.preprocessor.message.cs'} }, match: '\\b(?:(warning)|(error))\\b\\s*(.*)(?=$)' }, 'property-accessors': { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [ {include: '#comment'}, {include: '#attribute-section'}, { match: '\\b(private|protected|internal)\\b', name: 'storage.modifier.$1.cs' }, { begin: '(?:\\b(readonly)\\s+)?\\b(get)\\b\\s*(?=\\{|;|=>|//|/\\*|$)', beginCaptures: { 1: {name: 'storage.modifier.readonly.cs'}, 2: {name: 'storage.type.accessor.get.cs'} }, end: '(?<=\\}|;)|(?=\\})', patterns: [{include: '#accessor-getter'}] }, { begin: '\\b(set|init)\\b\\s*(?=\\{|;|=>|//|/\\*|$)', beginCaptures: {1: {name: 'storage.type.accessor.$1.cs'}}, end: '(?<=\\}|;)|(?=\\})', patterns: [{include: '#accessor-setter'}] } ] }, '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(?=\\{|=>|//|/\\*|$)", beginCaptures: { 1: {patterns: [{include: '#type'}]}, 7: {patterns: [{include: '#type'}, {include: '#punctuation-accessor'}]}, 8: {name: 'entity.name.variable.property.cs'} }, end: '(?<=\\})|(?=;)', patterns: [ {include: '#comment'}, {include: '#property-accessors'}, {include: '#accessor-getter-expression'}, {include: '#variable-initializer'}, {include: '#class-or-struct-members'} ] }, 'property-pattern': { begin: '(?={)', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#subpattern'}, {include: '#punctuation-comma'}] }, { begin: '(?<=\\})', end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [ {include: '#intrusive'}, {include: '#simple-designation-pattern'} ] } ] }, 'punctuation-accessor': {match: '\\.', name: 'punctuation.accessor.cs'}, 'punctuation-comma': {match: ',', name: 'punctuation.separator.comma.cs'}, 'punctuation-semicolon': { match: ';', name: 'punctuation.terminator.statement.cs' }, 'query-body': { patterns: [ {include: '#let-clause'}, {include: '#where-clause'}, {include: '#join-clause'}, {include: '#orderby-clause'}, {include: '#select-clause'}, {include: '#group-clause'} ] }, 'query-expression': { 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'}, 2: {patterns: [{include: '#type'}]}, 7: {name: 'entity.name.variable.range-variable.cs'}, 8: {name: 'keyword.operator.expression.query.in.cs'} }, end: '(?=;|\\))', patterns: [{include: '#query-body'}, {include: '#expression'}] }, 'raw-interpolated-string': { patterns: [ { include: '#raw-interpolated-string-five-or-more-quote-one-or-more-interpolation' }, { include: '#raw-interpolated-string-three-or-more-quote-three-or-more-interpolation' }, { include: '#raw-interpolated-string-quadruple-quote-double-interpolation' }, { include: '#raw-interpolated-string-quadruple-quote-single-interpolation' }, {include: '#raw-interpolated-string-triple-quote-double-interpolation'}, {include: '#raw-interpolated-string-triple-quote-single-interpolation'} ] }, 'raw-interpolated-string-five-or-more-quote-one-or-more-interpolation': { begin: '\\$+"""""+', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""""+', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs' }, 'raw-interpolated-string-quadruple-quote-double-interpolation': { begin: '\\$\\$""""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '""""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#double-raw-interpolation'}] }, 'raw-interpolated-string-quadruple-quote-single-interpolation': { begin: '\\$""""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '""""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#raw-interpolation'}] }, 'raw-interpolated-string-three-or-more-quote-three-or-more-interpolation': { begin: '\\$\\$\\$+"""+', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""+', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs' }, 'raw-interpolated-string-triple-quote-double-interpolation': { begin: '\\$\\$"""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#double-raw-interpolation'}] }, 'raw-interpolated-string-triple-quote-single-interpolation': { begin: '\\$"""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#raw-interpolation'}] }, 'raw-interpolation': { begin: '(?<=[^\\{]|^)((?:\\{)*)(\\{)(?=[^\\{])', beginCaptures: { 1: {name: 'string.quoted.double.cs'}, 2: {name: 'punctuation.definition.interpolation.begin.cs'} }, end: '\\}', endCaptures: {0: {name: 'punctuation.definition.interpolation.end.cs'}}, name: 'meta.embedded.interpolation.cs', patterns: [{include: '#expression'}] }, 'raw-string-literal': { patterns: [ {include: '#raw-string-literal-more'}, {include: '#raw-string-literal-quadruple'}, {include: '#raw-string-literal-triple'} ] }, 'raw-string-literal-more': { begin: '"""""+', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""""+', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs' }, 'raw-string-literal-quadruple': { begin: '""""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '""""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs' }, 'raw-string-literal-triple': { begin: '"""', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"""', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs' }, 'readonly-modifier': { match: '\\breadonly\\b', name: 'storage.modifier.readonly.cs' }, 'record-declaration': { begin: '(?=\\brecord\\b)', end: '(?<=\\})|(?=;)', patterns: [ { begin: '(?x)\n(record)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)', beginCaptures: { 1: {name: 'storage.type.record.cs'}, 2: {name: 'entity.name.type.class.cs'} }, end: '(?=\\{)|(?=;)', patterns: [ {include: '#comment'}, {include: '#type-parameter-list'}, {include: '#parenthesized-parameter-list'}, {include: '#base-types'}, {include: '#generic-constraints'} ] }, { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#class-or-struct-members'}] }, {include: '#preprocessor'}, {include: '#comment'} ] }, 'ref-modifier': {match: '\\bref\\b', name: 'storage.modifier.ref.cs'}, 'relational-pattern': { begin: '<=?|>=?', beginCaptures: {0: {name: 'keyword.operator.relational.cs'}}, end: '(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)', patterns: [{include: '#expression'}] }, 'return-statement': { 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'}] } ] }, 'switch-label': { begin: '\\b(case|default)\\b', beginCaptures: {1: {name: 'keyword.control.conditional.$1.cs'}}, end: '(:)|(?=})', endCaptures: {1: {name: 'punctuation.separator.colon.cs'}}, patterns: [ { 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'}] } ] }, 'switch-statement': { patterns: [ {include: '#intrusive'}, { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#expression'}] }, { begin: '\\{', beginCaptures: {0: {name: 'punctuation.curlybrace.open.cs'}}, end: '\\}', endCaptures: {0: {name: 'punctuation.curlybrace.close.cs'}}, patterns: [{include: '#switch-label'}, {include: '#statement'}] } ] }, 'switch-statement-or-expression': { begin: '(?\\s*\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)' }, 'tuple-deconstruction-element-list': { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ {include: '#comment'}, {include: '#tuple-deconstruction-element-list'}, {include: '#declaration-expression-tuple'}, {include: '#punctuation-comma'}, { captures: {1: {name: 'variable.other.readwrite.cs'}}, match: '(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])' } ] }, 'tuple-element': { captures: { 1: {patterns: [{include: '#type'}]}, 6: {name: 'entity.name.variable.tuple-element.cs'} }, 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)\n(?:(?\\g)\\b)?' }, 'tuple-literal': { begin: '(\\()(?=.*[:,])', beginCaptures: {1: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [ {include: '#comment'}, {include: '#tuple-literal-element'}, {include: '#expression'}, {include: '#punctuation-comma'} ] }, 'tuple-literal-element': { begin: '(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*\n(?=:)', beginCaptures: {1: {name: 'entity.name.variable.tuple-element.cs'}}, end: '(:)', endCaptures: {0: {name: 'punctuation.separator.colon.cs'}} }, 'tuple-type': { begin: '\\(', beginCaptures: {0: {name: 'punctuation.parenthesis.open.cs'}}, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#tuple-element'}, {include: '#punctuation-comma'}] }, type: { patterns: [ {include: '#comment'}, {include: '#ref-modifier'}, {include: '#readonly-modifier'}, {include: '#tuple-type'}, {include: '#type-builtin'}, {include: '#type-name'}, {include: '#type-arguments'}, {include: '#type-array-suffix'}, {include: '#type-nullable-suffix'}, {include: '#type-pointer-suffix'} ] }, 'type-arguments': { begin: '<', beginCaptures: { 0: {name: 'punctuation.definition.typeparameters.begin.cs'} }, end: '>', endCaptures: {0: {name: 'punctuation.definition.typeparameters.end.cs'}}, patterns: [{include: '#type'}, {include: '#punctuation-comma'}] }, 'type-array-suffix': { begin: '\\[', beginCaptures: {0: {name: 'punctuation.squarebracket.open.cs'}}, end: '\\]', endCaptures: {0: {name: 'punctuation.squarebracket.close.cs'}}, patterns: [{include: '#intrusive'}, {include: '#punctuation-comma'}] }, 'type-builtin': { captures: {1: {name: 'keyword.type.$1.cs'}}, match: '\\b(bool|s?byte|u?short|n?u?int|u?long|float|double|decimal|char|string|object|void|dynamic)\\b' }, 'type-declarations': { patterns: [ {include: '#preprocessor'}, {include: '#comment'}, {include: '#storage-modifier'}, {include: '#class-declaration'}, {include: '#delegate-declaration'}, {include: '#enum-declaration'}, {include: '#interface-declaration'}, {include: '#struct-declaration'}, {include: '#record-declaration'}, {include: '#attribute-section'}, {include: '#punctuation-semicolon'} ] }, 'type-name': { patterns: [ { captures: { 1: {name: 'entity.name.type.alias.cs'}, 2: {name: 'punctuation.separator.coloncolon.cs'} }, match: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)' }, { captures: { 1: {name: 'entity.name.type.cs'}, 2: {name: 'punctuation.accessor.cs'} }, match: '(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)' }, { captures: { 1: {name: 'punctuation.accessor.cs'}, 2: {name: 'entity.name.type.cs'} }, match: '(\\.)\\s*(@?[_[:alpha:]][_[:alnum:]]*)' }, {match: '@?[_[:alpha:]][_[:alnum:]]*', name: 'entity.name.type.cs'} ] }, 'type-nullable-suffix': { match: '\\?', name: 'punctuation.separator.question-mark.cs' }, 'type-operator-expression': { begin: '\\b(default|sizeof|typeof)\\s*(\\()', beginCaptures: { 1: {name: 'keyword.operator.expression.$1.cs'}, 2: {name: 'punctuation.parenthesis.open.cs'} }, end: '\\)', endCaptures: {0: {name: 'punctuation.parenthesis.close.cs'}}, patterns: [{include: '#type'}] }, 'type-parameter-list': { begin: '\\<', beginCaptures: { 0: {name: 'punctuation.definition.typeparameters.begin.cs'} }, end: '\\>', endCaptures: {0: {name: 'punctuation.definition.typeparameters.end.cs'}}, patterns: [ {match: '\\b(in|out)\\b', name: 'storage.modifier.$1.cs'}, { match: '(@?[_[:alpha:]][_[:alnum:]]*)\\b', name: 'entity.name.type.type-parameter.cs' }, {include: '#comment'}, {include: '#punctuation-comma'}, {include: '#attribute-section'} ] }, '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-pointer-suffix': { match: '\\*', name: 'punctuation.separator.asterisk.cs' }, '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: '(?)', beginCaptures: {1: {name: 'keyword.operator.assignment.cs'}}, end: '(?=[,\\)\\];}])', patterns: [{include: '#ref-modifier'}, {include: '#expression'}] }, 'verbatim-interpolated-string': { begin: '(?:\\$@|@\\$)"', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"(?=[^"])', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [ {include: '#verbatim-string-character-escape'}, {include: '#interpolation'} ] }, 'verbatim-string-character-escape': { match: '""', name: 'constant.character.escape.cs' }, 'verbatim-string-literal': { begin: '@"', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '"(?=[^"])', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#verbatim-string-character-escape'}] }, 'when-clause': { begin: '(?', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.unquoted.cdata.cs' }, 'xml-character-entity': { patterns: [ { captures: { 1: {name: 'punctuation.definition.constant.cs'}, 3: {name: 'punctuation.definition.constant.cs'} }, match: '(?x)\n(&)\n(\n (?:[[:alpha:]:_][[:alnum:]:_.-]*)|\n (?:\\#[[:digit:]]+)|\n (?:\\#x[[:xdigit:]]+)\n)\n(;)', name: 'constant.character.entity.cs' }, {match: '&', name: 'invalid.illegal.bad-ampersand.cs'} ] }, 'xml-comment': { begin: '', endCaptures: {0: {name: 'punctuation.definition.comment.cs'}}, name: 'comment.block.cs' }, 'xml-doc-comment': { patterns: [ {include: '#xml-comment'}, {include: '#xml-character-entity'}, {include: '#xml-cdata'}, {include: '#xml-tag'} ] }, 'xml-string': { patterns: [ { begin: "\\'", beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: "\\'", endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.single.cs', patterns: [{include: '#xml-character-entity'}] }, { begin: '\\"', beginCaptures: {0: {name: 'punctuation.definition.string.begin.cs'}}, end: '\\"', endCaptures: {0: {name: 'punctuation.definition.string.end.cs'}}, name: 'string.quoted.double.cs', patterns: [{include: '#xml-character-entity'}] } ] }, 'xml-tag': { begin: '(?x)\n()', endCaptures: {1: {name: 'punctuation.definition.tag.cs'}}, name: 'meta.tag.cs', patterns: [{include: '#xml-attribute'}] }, 'yield-break-statement': { captures: { 1: {name: 'keyword.control.flow.yield.cs'}, 2: {name: 'keyword.control.flow.break.cs'} }, match: '(?