diff --git a/.vscode/launch.json b/.vscode/launch.json
index a8051d9dc9..da13935c6d 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -40,6 +40,20 @@
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "CompileUnitTests"
},
+ {
+ "type": "node",
+ "request": "launch",
+ "name": "Run Grammar Tests",
+ "runtimeExecutable": "yarn",
+ "cwd": "${workspaceFolder}/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test",
+ "runtimeArgs": [
+ "test:debug"
+ ],
+ "port": 9229,
+ "sourceMaps": true,
+ "internalConsoleOptions": "openOnSessionStart",
+ "preLaunchTask": "CompileGrammarTests"
+ },
{
"name": "Run Functional Tests",
"type": "extensionHost",
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 5ae8567f4b..60280b4209 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -85,6 +85,20 @@
"reveal": "silent"
}
},
+ {
+ "label": "CompileGrammarTests",
+ "command": "dotnet",
+ "args": [
+ "build"
+ ],
+ "options": {
+ "cwd": "src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/"
+ },
+ "problemMatcher": "$tsc-watch",
+ "presentation": {
+ "reveal": "silent"
+ }
+ },
{
"label": "CompileFunctionalTest",
"command": "dotnet",
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test.npmproj b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test.npmproj
new file mode 100644
index 0000000000..cb5503fe53
--- /dev/null
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test.npmproj
@@ -0,0 +1,27 @@
+
+
+
+
+
+ netstandard2.0
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/JavaScript.tmLanguage.json b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/JavaScript.tmLanguage.json
new file mode 100644
index 0000000000..c837748555
--- /dev/null
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/JavaScript.tmLanguage.json
@@ -0,0 +1,5658 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
+ "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/Microsoft/TypeScript-TmLanguage/commit/4daff7b8904bc549dfbee8df1e2f7c82194b9f45",
+ "name": "JavaScript (with React support)",
+ "scopeName": "source.js",
+ "patterns": [
+ {
+ "include": "#directives"
+ },
+ {
+ "include": "#statements"
+ },
+ {
+ "name": "comment.line.shebang.ts",
+ "match": "\\A(#!).*(?=$)",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.comment.ts"
+ }
+ }
+ }
+ ],
+ "repository": {
+ "statements": {
+ "patterns": [
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#declaration"
+ },
+ {
+ "include": "#control-statement"
+ },
+ {
+ "include": "#after-operator-block-as-object-literal"
+ },
+ {
+ "include": "#decl-block"
+ },
+ {
+ "include": "#label"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "declaration": {
+ "patterns": [
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#var-expr"
+ },
+ {
+ "include": "#function-declaration"
+ },
+ {
+ "include": "#class-declaration"
+ },
+ {
+ "include": "#interface-declaration"
+ },
+ {
+ "include": "#enum-declaration"
+ },
+ {
+ "include": "#namespace-declaration"
+ },
+ {
+ "include": "#type-alias-declaration"
+ },
+ {
+ "include": "#import-equals-declaration"
+ },
+ {
+ "include": "#import-declaration"
+ },
+ {
+ "include": "#export-declaration"
+ },
+ {
+ "name": "storage.modifier.js",
+ "match": "(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "beginCaptures": {
+ "1": {
+ "name": "meta.definition.variable.js entity.name.function.js"
+ },
+ "2": {
+ "name": "keyword.operator.definiteassignment.js"
+ }
+ },
+ "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "beginCaptures": {
+ "1": {
+ "name": "meta.definition.variable.js variable.other.constant.js entity.name.function.js"
+ }
+ },
+ "end": "(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "keyword.operator.rest.js"
+ },
+ "3": {
+ "name": "entity.name.function.js variable.language.this.js"
+ },
+ "4": {
+ "name": "entity.name.function.js"
+ },
+ "5": {
+ "name": "keyword.operator.optional.js"
+ }
+ }
+ },
+ {
+ "match": "(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "captures": {
+ "1": {
+ "name": "meta.definition.property.js entity.name.function.js"
+ },
+ "2": {
+ "name": "keyword.operator.optional.js"
+ },
+ "3": {
+ "name": "keyword.operator.definiteassignment.js"
+ }
+ }
+ },
+ {
+ "name": "meta.definition.property.js variable.object.property.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ },
+ {
+ "name": "keyword.operator.optional.js",
+ "match": "\\?"
+ },
+ {
+ "name": "keyword.operator.definiteassignment.js",
+ "match": "\\!"
+ }
+ ]
+ },
+ "variable-initializer": {
+ "patterns": [
+ {
+ "begin": "(?\\s*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.assignment.js"
+ }
+ },
+ "end": "(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.modifier.async.js"
+ },
+ "4": {
+ "name": "keyword.operator.new.js"
+ },
+ "5": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\}|;|,|$)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ },
+ {
+ "include": "#function-body"
+ }
+ ]
+ },
+ {
+ "name": "meta.method.declaration.js",
+ "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.modifier.async.js"
+ },
+ "4": {
+ "name": "storage.type.property.js"
+ },
+ "5": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\}|;|,|$)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ },
+ {
+ "include": "#function-body"
+ }
+ ]
+ }
+ ]
+ },
+ "object-literal-method-declaration": {
+ "name": "meta.method.declaration.js",
+ "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ },
+ "2": {
+ "name": "storage.type.property.js"
+ },
+ "3": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\}|;|,)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ },
+ {
+ "include": "#function-body"
+ },
+ {
+ "begin": "(?x)(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ },
+ "2": {
+ "name": "storage.type.property.js"
+ },
+ "3": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\(|\\<)",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ }
+ ]
+ }
+ ]
+ },
+ "method-declaration-name": {
+ "begin": "(?x)(?=((\\b(?)",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ },
+ "2": {
+ "name": "variable.parameter.js"
+ }
+ }
+ },
+ {
+ "name": "meta.arrow.js",
+ "begin": "(?x) (?:\n (? is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ }
+ },
+ "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#function-parameters"
+ },
+ {
+ "include": "#arrow-return-type"
+ },
+ {
+ "include": "#possibly-arrow-return-type"
+ }
+ ]
+ },
+ {
+ "name": "meta.arrow.js",
+ "begin": "=>",
+ "beginCaptures": {
+ "0": {
+ "name": "storage.type.function.arrow.js"
+ }
+ },
+ "end": "((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])",
+ "patterns": [
+ {
+ "include": "#single-line-comment-consuming-line-ending"
+ },
+ {
+ "include": "#decl-block"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ }
+ ]
+ },
+ "indexer-declaration": {
+ "name": "meta.indexer.declaration.js",
+ "begin": "(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#object-member"
+ }
+ ]
+ },
+ "object-literal": {
+ "name": "meta.objectliteral.js",
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#object-member"
+ }
+ ]
+ },
+ "object-member": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#object-literal-method-declaration"
+ },
+ {
+ "name": "meta.object.member.js meta.object-literal.key.js",
+ "begin": "(?=\\[)",
+ "end": "(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#array-literal"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js meta.object-literal.key.js",
+ "begin": "(?=[\\'\\\"\\`])",
+ "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js meta.object-literal.key.js",
+ "begin": "(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "captures": {
+ "0": {
+ "name": "meta.object-literal.key.js"
+ },
+ "1": {
+ "name": "entity.name.function.js"
+ }
+ }
+ },
+ {
+ "name": "meta.object.member.js",
+ "match": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)",
+ "captures": {
+ "0": {
+ "name": "meta.object-literal.key.js"
+ }
+ }
+ },
+ {
+ "name": "meta.object.member.js",
+ "begin": "\\.\\.\\.",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.spread.js"
+ }
+ },
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)",
+ "captures": {
+ "1": {
+ "name": "variable.other.readwrite.js"
+ }
+ }
+ },
+ {
+ "name": "meta.object.member.js",
+ "match": "(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression-inside-possibly-arrow-parens"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ },
+ "2": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression-inside-possibly-arrow-parens"
+ }
+ ]
+ },
+ {
+ "include": "#possibly-arrow-return-type"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "ternary-expression": {
+ "begin": "(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.ternary.js"
+ }
+ },
+ "end": "\\s*(:)",
+ "endCaptures": {
+ "1": {
+ "name": "keyword.operator.ternary.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "function-call": {
+ "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()",
+ "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()",
+ "patterns": [
+ {
+ "name": "meta.function-call.js",
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
+ "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()",
+ "patterns": [
+ {
+ "include": "#support-function-call-identifiers"
+ },
+ {
+ "name": "entity.name.function.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ }
+ ]
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "meta.function-call.js punctuation.accessor.optional.js",
+ "match": "\\?\\."
+ },
+ {
+ "name": "meta.function-call.js keyword.operator.definiteassignment.js",
+ "match": "\\!"
+ },
+ {
+ "include": "#type-arguments"
+ },
+ {
+ "include": "#paren-expression"
+ }
+ ]
+ },
+ "support-function-call-identifiers": {
+ "patterns": [
+ {
+ "include": "#literal"
+ },
+ {
+ "include": "#support-objects"
+ },
+ {
+ "include": "#object-identifiers"
+ },
+ {
+ "include": "#punctuation-accessor"
+ },
+ {
+ "name": "keyword.operator.expression.import.js",
+ "match": "(?:(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#paren-expression-possibly-arrow-with-typeparameters"
+ }
+ ]
+ },
+ {
+ "begin": "(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<))\\s*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.async.js"
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#paren-expression-possibly-arrow-with-typeparameters"
+ }
+ ]
+ },
+ {
+ "include": "#possibly-arrow-return-type"
+ }
+ ]
+ },
+ "paren-expression-possibly-arrow-with-typeparameters": {
+ "patterns": [
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression-inside-possibly-arrow-parens"
+ }
+ ]
+ }
+ ]
+ },
+ "expression-inside-possibly-arrow-parens": {
+ "patterns": [
+ {
+ "include": "#expressionWithoutIdentifiers"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#destructuring-parameter"
+ },
+ {
+ "match": "(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "keyword.operator.rest.js"
+ },
+ "3": {
+ "name": "entity.name.function.js variable.language.this.js"
+ },
+ "4": {
+ "name": "entity.name.function.js"
+ },
+ "5": {
+ "name": "keyword.operator.optional.js"
+ }
+ }
+ },
+ {
+ "match": "(?x)(?:(?>=|>>>=|\\|="
+ },
+ {
+ "name": "keyword.operator.bitwise.shift.js",
+ "match": "<<|>>>|>>"
+ },
+ {
+ "name": "keyword.operator.comparison.js",
+ "match": "===|!==|==|!="
+ },
+ {
+ "name": "keyword.operator.relational.js",
+ "match": "<=|>=|<>|<|>"
+ },
+ {
+ "name": "keyword.operator.logical.js",
+ "match": "\\!|&&|\\|\\||\\?\\?"
+ },
+ {
+ "name": "keyword.operator.bitwise.js",
+ "match": "\\&|~|\\^|\\|"
+ },
+ {
+ "name": "keyword.operator.assignment.js",
+ "match": "\\="
+ },
+ {
+ "name": "keyword.operator.decrement.js",
+ "match": "--"
+ },
+ {
+ "name": "keyword.operator.increment.js",
+ "match": "\\+\\+"
+ },
+ {
+ "name": "keyword.operator.arithmetic.js",
+ "match": "%|\\*|/|-|\\+"
+ },
+ {
+ "begin": "(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(/)(?![/*]))",
+ "end": "(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)",
+ "endCaptures": {
+ "1": {
+ "name": "keyword.operator.arithmetic.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ {
+ "match": "(?<=[_$[:alnum:])\\]])\\s*(/)(?![/*])",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.arithmetic.js"
+ }
+ }
+ }
+ ]
+ },
+ "typeof-operator": {
+ "name": "keyword.operator.expression.typeof.js",
+ "match": "(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ },
+ "3": {
+ "name": "support.variable.property.js"
+ },
+ "4": {
+ "name": "support.constant.js"
+ }
+ }
+ },
+ {
+ "name": "support.class.node.js",
+ "match": "(?x)(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ },
+ "3": {
+ "name": "entity.name.function.js"
+ }
+ }
+ },
+ {
+ "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ },
+ "3": {
+ "name": "variable.other.constant.property.js"
+ }
+ }
+ },
+ {
+ "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ },
+ "3": {
+ "name": "variable.other.property.js"
+ }
+ }
+ },
+ {
+ "name": "variable.other.constant.js",
+ "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
+ },
+ {
+ "name": "variable.other.readwrite.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ }
+ ]
+ },
+ "object-identifiers": {
+ "patterns": [
+ {
+ "name": "support.class.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))"
+ },
+ {
+ "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ },
+ "3": {
+ "name": "variable.other.constant.object.property.js"
+ },
+ "4": {
+ "name": "variable.other.object.property.js"
+ }
+ }
+ },
+ {
+ "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "variable.other.constant.object.js"
+ },
+ "2": {
+ "name": "variable.other.object.js"
+ }
+ }
+ }
+ ]
+ },
+ "type-annotation": {
+ "patterns": [
+ {
+ "name": "meta.type.annotation.js",
+ "begin": "(:)(?=\\s*\\S)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ {
+ "name": "meta.type.annotation.js",
+ "begin": "(:)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ ]
+ },
+ "parameter-type-annotation": {
+ "patterns": [
+ {
+ "name": "meta.type.annotation.js",
+ "begin": "(:)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?=[,)])|(?==[^>])",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ ]
+ },
+ "return-type": {
+ "patterns": [
+ {
+ "name": "meta.return.type.js",
+ "begin": "(?<=\\))\\s*(:)(?=\\s*\\S)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))",
+ "patterns": [
+ {
+ "include": "#arrow-return-type-body"
+ }
+ ]
+ },
+ "possibly-arrow-return-type": {
+ "begin": "(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)",
+ "beginCaptures": {
+ "1": {
+ "name": "meta.arrow.js meta.return.type.arrow.js keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))",
+ "contentName": "meta.arrow.js meta.return.type.arrow.js",
+ "patterns": [
+ {
+ "include": "#arrow-return-type-body"
+ }
+ ]
+ },
+ "arrow-return-type-body": {
+ "patterns": [
+ {
+ "begin": "(?<=[:])(?=\\s*\\{)",
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#type-object"
+ }
+ ]
+ },
+ {
+ "include": "#type-predicate-operator"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "type-parameters": {
+ "name": "meta.type.parameters.js",
+ "begin": "(<)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.typeparameters.begin.js"
+ }
+ },
+ "end": "(>)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "storage.modifier.js",
+ "match": "(?)"
+ }
+ ]
+ },
+ "type-arguments": {
+ "name": "meta.type.parameters.js",
+ "begin": "\\<",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.typeparameters.begin.js"
+ }
+ },
+ "end": "\\>",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type-arguments-body"
+ }
+ ]
+ },
+ "type-arguments-body": {
+ "patterns": [
+ {
+ "match": "(?)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "keyword.operator.rest.js"
+ },
+ "3": {
+ "name": "entity.name.function.js variable.language.this.js"
+ },
+ "4": {
+ "name": "entity.name.function.js"
+ },
+ "5": {
+ "name": "keyword.operator.optional.js"
+ }
+ }
+ },
+ {
+ "match": "(?x)(?:(?)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-parameters"
+ }
+ ]
+ },
+ {
+ "name": "meta.type.constructor.js",
+ "begin": "(?)\n ))\n )\n )\n)",
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#function-parameters"
+ }
+ ]
+ }
+ ]
+ },
+ "type-function-return-type": {
+ "patterns": [
+ {
+ "name": "meta.type.function.return.js",
+ "begin": "(=>)(?=\\s*\\S)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.function.arrow.js"
+ }
+ },
+ "end": "(?)(?:\\?]|//|$)",
+ "patterns": [
+ {
+ "include": "#type-function-return-type-core"
+ }
+ ]
+ },
+ {
+ "name": "meta.type.function.return.js",
+ "begin": "=>",
+ "beginCaptures": {
+ "0": {
+ "name": "storage.type.function.arrow.js"
+ }
+ },
+ "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))",
+ "patterns": [
+ {
+ "include": "#type-function-return-type-core"
+ }
+ ]
+ }
+ ]
+ },
+ "type-function-return-type-core": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "begin": "(?<==>)(?=\\s*\\{)",
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#type-object"
+ }
+ ]
+ },
+ {
+ "include": "#type-predicate-operator"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "type-operators": {
+ "patterns": [
+ {
+ "include": "#typeof-operator"
+ },
+ {
+ "begin": "([&|])(?=\\s*\\{)",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.type.js"
+ }
+ },
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#type-object"
+ }
+ ]
+ },
+ {
+ "begin": "[&|]",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.type.js"
+ }
+ },
+ "end": "(?=\\S)"
+ },
+ {
+ "name": "keyword.operator.expression.keyof.js",
+ "match": "(?)",
+ "endCaptures": {
+ "1": {
+ "name": "meta.type.parameters.js punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "contentName": "meta.type.parameters.js",
+ "patterns": [
+ {
+ "include": "#type-arguments-body"
+ }
+ ]
+ },
+ {
+ "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.type.js"
+ },
+ "2": {
+ "name": "meta.type.parameters.js punctuation.definition.typeparameters.begin.js"
+ }
+ },
+ "end": "(>)",
+ "endCaptures": {
+ "1": {
+ "name": "meta.type.parameters.js punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "contentName": "meta.type.parameters.js",
+ "patterns": [
+ {
+ "include": "#type-arguments-body"
+ }
+ ]
+ },
+ {
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))",
+ "captures": {
+ "1": {
+ "name": "entity.name.type.module.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.js"
+ },
+ "3": {
+ "name": "punctuation.accessor.optional.js"
+ }
+ }
+ },
+ {
+ "name": "entity.name.type.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ }
+ ]
+ },
+ "punctuation-comma": {
+ "name": "punctuation.separator.comma.js",
+ "match": ","
+ },
+ "punctuation-semicolon": {
+ "name": "punctuation.terminator.statement.js",
+ "match": ";"
+ },
+ "punctuation-accessor": {
+ "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.js"
+ },
+ "2": {
+ "name": "punctuation.accessor.optional.js"
+ }
+ }
+ },
+ "string": {
+ "patterns": [
+ {
+ "include": "#qstring-single"
+ },
+ {
+ "include": "#qstring-double"
+ },
+ {
+ "include": "#template"
+ }
+ ]
+ },
+ "qstring-double": {
+ "name": "string.quoted.double.js",
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(\")|((?:[^\\\\\\n])$)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ },
+ "qstring-single": {
+ "name": "string.quoted.single.js",
+ "begin": "'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(\\')|((?:[^\\\\\\n])$)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ },
+ "string-character-escape": {
+ "name": "constant.character.escape.js",
+ "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)"
+ },
+ "template": {
+ "patterns": [
+ {
+ "name": "string.template.js",
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)",
+ "end": "(?=`)",
+ "patterns": [
+ {
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
+ "end": "(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)",
+ "patterns": [
+ {
+ "include": "#support-function-call-identifiers"
+ },
+ {
+ "name": "entity.name.function.tagged-template.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ }
+ ]
+ },
+ {
+ "include": "#type-arguments"
+ }
+ ]
+ },
+ {
+ "name": "string.template.js",
+ "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.tagged-template.js"
+ }
+ },
+ "end": "(?=`)",
+ "patterns": [
+ {
+ "include": "#type-arguments"
+ }
+ ]
+ },
+ {
+ "name": "string.template.js",
+ "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.function.tagged-template.js"
+ },
+ "2": {
+ "name": "punctuation.definition.string.template.begin.js"
+ }
+ },
+ "end": "`",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.template.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#template-substitution-element"
+ },
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ }
+ ]
+ },
+ "template-substitution-element": {
+ "name": "meta.template.expression.js",
+ "begin": "\\$\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.template-expression.begin.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.template-expression.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ],
+ "contentName": "meta.embedded.line.js"
+ },
+ "regex": {
+ "patterns": [
+ {
+ "name": "string.regexp.js",
+ "begin": "(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([gimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(/)([gimsuy]*)",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name": "keyword.other.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ },
+ {
+ "name": "string.regexp.js",
+ "begin": "((?",
+ "captures": {
+ "0": {
+ "name": "keyword.other.back-reference.regexp"
+ },
+ "1": {
+ "name": "variable.other.regexp"
+ }
+ }
+ },
+ {
+ "name": "keyword.operator.quantifier.regexp",
+ "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??"
+ },
+ {
+ "name": "keyword.operator.or.regexp",
+ "match": "\\|"
+ },
+ {
+ "name": "meta.group.assertion.regexp",
+ "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.group.regexp"
+ },
+ "1": {
+ "name": "punctuation.definition.group.no-capture.regexp"
+ },
+ "2": {
+ "name": "variable.other.regexp"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.group.regexp"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ },
+ {
+ "name": "constant.other.character-class.set.regexp",
+ "begin": "(\\[)(\\^)?",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.character-class.regexp"
+ },
+ "2": {
+ "name": "keyword.operator.negation.regexp"
+ }
+ },
+ "end": "(\\])",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.character-class.regexp"
+ }
+ },
+ "patterns": [
+ {
+ "name": "constant.other.character-class.range.regexp",
+ "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))",
+ "captures": {
+ "1": {
+ "name": "constant.character.numeric.regexp"
+ },
+ "2": {
+ "name": "constant.character.control.regexp"
+ },
+ "3": {
+ "name": "constant.character.escape.backslash.regexp"
+ },
+ "4": {
+ "name": "constant.character.numeric.regexp"
+ },
+ "5": {
+ "name": "constant.character.control.regexp"
+ },
+ "6": {
+ "name": "constant.character.escape.backslash.regexp"
+ }
+ }
+ },
+ {
+ "include": "#regex-character-class"
+ }
+ ]
+ },
+ {
+ "include": "#regex-character-class"
+ }
+ ]
+ },
+ "regex-character-class": {
+ "patterns": [
+ {
+ "name": "constant.other.character-class.regexp",
+ "match": "\\\\[wWsSdDtrnvf]|\\."
+ },
+ {
+ "name": "constant.character.numeric.regexp",
+ "match": "\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})"
+ },
+ {
+ "name": "constant.character.control.regexp",
+ "match": "\\\\c[A-Z]"
+ },
+ {
+ "name": "constant.character.escape.backslash.regexp",
+ "match": "\\\\."
+ }
+ ]
+ },
+ "comment": {
+ "patterns": [
+ {
+ "name": "comment.block.documentation.js",
+ "begin": "/\\*\\*(?!/)",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.js"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#docblock"
+ }
+ ]
+ },
+ {
+ "name": "comment.block.js",
+ "begin": "(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.js"
+ },
+ "2": {
+ "name": "storage.type.internaldeclaration.js"
+ },
+ "3": {
+ "name": "punctuation.decorator.internaldeclaration.js"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.comment.js"
+ }
+ }
+ },
+ {
+ "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.js"
+ },
+ "2": {
+ "name": "comment.line.double-slash.js"
+ },
+ "3": {
+ "name": "punctuation.definition.comment.js"
+ },
+ "4": {
+ "name": "storage.type.internaldeclaration.js"
+ },
+ "5": {
+ "name": "punctuation.decorator.internaldeclaration.js"
+ }
+ },
+ "end": "(?=$)",
+ "contentName": "comment.line.double-slash.js"
+ }
+ ]
+ },
+ "single-line-comment-consuming-line-ending": {
+ "begin": "(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.whitespace.comment.leading.js"
+ },
+ "2": {
+ "name": "comment.line.double-slash.js"
+ },
+ "3": {
+ "name": "punctuation.definition.comment.js"
+ },
+ "4": {
+ "name": "storage.type.internaldeclaration.js"
+ },
+ "5": {
+ "name": "punctuation.decorator.internaldeclaration.js"
+ }
+ },
+ "end": "(?=^)",
+ "contentName": "comment.line.double-slash.js"
+ },
+ "directives": {
+ "name": "comment.line.triple-slash.directive.js",
+ "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.comment.js"
+ }
+ },
+ "end": "(?=$)",
+ "patterns": [
+ {
+ "name": "meta.tag.js",
+ "begin": "(<)(reference|amd-dependency|amd-module)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.directive.js"
+ },
+ "2": {
+ "name": "entity.name.tag.directive.js"
+ }
+ },
+ "end": "/>",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.tag.directive.js"
+ }
+ },
+ "patterns": [
+ {
+ "name": "entity.other.attribute-name.directive.js",
+ "match": "path|types|no-default-lib|lib|name"
+ },
+ {
+ "name": "keyword.operator.assignment.js",
+ "match": "="
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "docblock": {
+ "patterns": [
+ {
+ "match": "(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "constant.language.access-type.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "entity.name.type.instance.jsdoc"
+ },
+ "4": {
+ "name": "punctuation.definition.bracket.angle.begin.jsdoc"
+ },
+ "5": {
+ "name": "constant.other.email.link.underline.jsdoc"
+ },
+ "6": {
+ "name": "punctuation.definition.bracket.angle.end.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "entity.name.type.instance.jsdoc"
+ },
+ "4": {
+ "name": "keyword.operator.control.jsdoc"
+ },
+ "5": {
+ "name": "entity.name.type.instance.jsdoc"
+ }
+ }
+ },
+ {
+ "name": "meta.example.jsdoc",
+ "begin": "((@)example)\\s+",
+ "end": "(?=@|\\*/)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ },
+ "patterns": [
+ {
+ "match": "^\\s\\*\\s+"
+ },
+ {
+ "contentName": "constant.other.description.jsdoc",
+ "begin": "\\G(<)caption(>)",
+ "beginCaptures": {
+ "0": {
+ "name": "entity.name.tag.inline.jsdoc"
+ },
+ "1": {
+ "name": "punctuation.definition.bracket.angle.begin.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.bracket.angle.end.jsdoc"
+ }
+ },
+ "end": "()caption(>)|(?=\\*/)",
+ "endCaptures": {
+ "0": {
+ "name": "entity.name.tag.inline.jsdoc"
+ },
+ "1": {
+ "name": "punctuation.definition.bracket.angle.begin.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.bracket.angle.end.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "[^\\s@*](?:[^*]|\\*[^/])*",
+ "captures": {
+ "0": {
+ "name": "source.embedded.js"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "match": "(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "constant.language.symbol-type.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "variable.other.link.underline.jsdoc"
+ },
+ "4": {
+ "name": "entity.name.type.instance.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "variable.other.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "variable.other.jsdoc"
+ }
+ }
+ },
+ {
+ "begin": "((@)typedef)\\s+(?={)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ },
+ "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])",
+ "patterns": [
+ {
+ "include": "#jsdoctype"
+ },
+ {
+ "name": "entity.name.type.instance.jsdoc",
+ "match": "(?:[^@\\s*/]|\\*[^/])+"
+ }
+ ]
+ },
+ {
+ "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ },
+ "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])",
+ "patterns": [
+ {
+ "include": "#jsdoctype"
+ },
+ {
+ "name": "variable.other.jsdoc",
+ "match": "([A-Za-z_$][\\w$.\\[\\]]*)"
+ },
+ {
+ "name": "variable.other.jsdoc",
+ "match": "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc"
+ },
+ "2": {
+ "name": "keyword.operator.assignment.jsdoc"
+ },
+ "3": {
+ "name": "source.embedded.js"
+ },
+ "4": {
+ "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc"
+ },
+ "5": {
+ "name": "invalid.illegal.syntax.jsdoc"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "begin": "(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ },
+ "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])",
+ "patterns": [
+ {
+ "include": "#jsdoctype"
+ }
+ ]
+ },
+ {
+ "match": "(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "entity.name.type.instance.jsdoc"
+ }
+ }
+ },
+ {
+ "contentName": "variable.other.jsdoc",
+ "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "variable.other.jsdoc"
+ },
+ "4": {
+ "name": "punctuation.definition.string.begin.jsdoc"
+ }
+ },
+ "end": "(\\3)|(?=$|\\*/)",
+ "endCaptures": {
+ "0": {
+ "name": "variable.other.jsdoc"
+ },
+ "1": {
+ "name": "punctuation.definition.string.end.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ },
+ "3": {
+ "name": "variable.other.jsdoc"
+ }
+ }
+ },
+ {
+ "name": "storage.type.class.jsdoc",
+ "match": "(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ }
+ },
+ {
+ "include": "#inline-tags"
+ },
+ {
+ "match": "((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)",
+ "captures": {
+ "1": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.block.tag.jsdoc"
+ }
+ }
+ }
+ ]
+ },
+ "brackets": {
+ "patterns": [
+ {
+ "begin": "{",
+ "end": "}|(?=\\*/)",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ },
+ {
+ "begin": "\\[",
+ "end": "\\]|(?=\\*/)",
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "inline-tags": {
+ "patterns": [
+ {
+ "name": "constant.other.description.jsdoc",
+ "match": "(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.bracket.square.begin.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.bracket.square.end.jsdoc"
+ }
+ }
+ },
+ {
+ "name": "entity.name.type.instance.jsdoc",
+ "begin": "({)((@)(?:link(?:code|plain)?|tutorial))\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.bracket.curly.begin.jsdoc"
+ },
+ "2": {
+ "name": "storage.type.class.jsdoc"
+ },
+ "3": {
+ "name": "punctuation.definition.inline.tag.jsdoc"
+ }
+ },
+ "end": "}|(?=\\*/)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.bracket.curly.end.jsdoc"
+ }
+ },
+ "patterns": [
+ {
+ "match": "\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?",
+ "captures": {
+ "1": {
+ "name": "variable.other.link.underline.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.separator.pipe.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?",
+ "captures": {
+ "1": {
+ "name": "variable.other.description.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.separator.pipe.jsdoc"
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "jsdoctype": {
+ "patterns": [
+ {
+ "contentName": "entity.name.type.instance.jsdoc",
+ "begin": "\\G({)",
+ "beginCaptures": {
+ "0": {
+ "name": "entity.name.type.instance.jsdoc"
+ },
+ "1": {
+ "name": "punctuation.definition.bracket.curly.begin.jsdoc"
+ }
+ },
+ "end": "((}))\\s*|(?=\\*/)",
+ "endCaptures": {
+ "1": {
+ "name": "entity.name.type.instance.jsdoc"
+ },
+ "2": {
+ "name": "punctuation.definition.bracket.curly.end.jsdoc"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#brackets"
+ }
+ ]
+ }
+ ]
+ },
+ "jsx": {
+ "patterns": [
+ {
+ "include": "#jsx-tag-without-attributes-in-expression"
+ },
+ {
+ "include": "#jsx-tag-in-expression"
+ }
+ ]
+ },
+ "jsx-tag-without-attributes-in-expression": {
+ "begin": "(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "end": "(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "patterns": [
+ {
+ "include": "#jsx-tag-without-attributes"
+ }
+ ]
+ },
+ "jsx-tag-without-attributes": {
+ "name": "meta.tag.without-attributes.js",
+ "begin": "(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)",
+ "end": "()\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name": "entity.name.tag.namespace.js"
+ },
+ "3": {
+ "name": "punctuation.separator.namespace.js"
+ },
+ "4": {
+ "name": "entity.name.tag.js"
+ },
+ "5": {
+ "name": "support.class.component.js"
+ },
+ "6": {
+ "name": "punctuation.definition.tag.end.js"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name": "entity.name.tag.namespace.js"
+ },
+ "3": {
+ "name": "punctuation.separator.namespace.js"
+ },
+ "4": {
+ "name": "entity.name.tag.js"
+ },
+ "5": {
+ "name": "support.class.component.js"
+ },
+ "6": {
+ "name": "punctuation.definition.tag.end.js"
+ }
+ },
+ "contentName": "meta.jsx.children.js",
+ "patterns": [
+ {
+ "include": "#jsx-children"
+ }
+ ]
+ },
+ "jsx-tag-in-expression": {
+ "begin": "(?x)\n (?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "end": "(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "patterns": [
+ {
+ "include": "#jsx-tag"
+ }
+ ]
+ },
+ "jsx-tag": {
+ "name": "meta.tag.js",
+ "begin": "(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "end": "(/>)|(?:()\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.end.js"
+ },
+ "2": {
+ "name": "punctuation.definition.tag.begin.js"
+ },
+ "3": {
+ "name": "entity.name.tag.namespace.js"
+ },
+ "4": {
+ "name": "punctuation.separator.namespace.js"
+ },
+ "5": {
+ "name": "entity.name.tag.js"
+ },
+ "6": {
+ "name": "support.class.component.js"
+ },
+ "7": {
+ "name": "punctuation.definition.tag.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name": "entity.name.tag.namespace.js"
+ },
+ "3": {
+ "name": "punctuation.separator.namespace.js"
+ },
+ "4": {
+ "name": "entity.name.tag.js"
+ },
+ "5": {
+ "name": "support.class.component.js"
+ }
+ },
+ "end": "(?=[/]?>)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-arguments"
+ },
+ {
+ "include": "#jsx-tag-attributes"
+ }
+ ]
+ },
+ {
+ "begin": "(>)",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.definition.tag.end.js"
+ }
+ },
+ "end": "(?=)",
+ "contentName": "meta.jsx.children.js",
+ "patterns": [
+ {
+ "include": "#jsx-children"
+ }
+ ]
+ }
+ ]
+ },
+ "jsx-children": {
+ "patterns": [
+ {
+ "include": "#jsx-tag-without-attributes"
+ },
+ {
+ "include": "#jsx-tag"
+ },
+ {
+ "include": "#jsx-evaluated-code"
+ },
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx-evaluated-code": {
+ "contentName": "meta.embedded.expression.js",
+ "begin": "\\{",
+ "end": "\\}",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.section.embedded.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "jsx-entities": {
+ "patterns": [
+ {
+ "name": "constant.character.entity.js",
+ "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
+ "captures": {
+ "1": {
+ "name": "punctuation.definition.entity.js"
+ },
+ "3": {
+ "name": "punctuation.definition.entity.js"
+ }
+ }
+ },
+ {
+ "name": "invalid.illegal.bad-ampersand.js",
+ "match": "&"
+ }
+ ]
+ },
+ "jsx-tag-attributes": {
+ "name": "meta.tag.attributes.js",
+ "begin": "\\s+",
+ "end": "(?=[/]?>)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#jsx-tag-attribute-name"
+ },
+ {
+ "include": "#jsx-tag-attribute-assignment"
+ },
+ {
+ "include": "#jsx-string-double-quoted"
+ },
+ {
+ "include": "#jsx-string-single-quoted"
+ },
+ {
+ "include": "#jsx-evaluated-code"
+ },
+ {
+ "include": "#jsx-tag-attributes-illegal"
+ }
+ ]
+ },
+ "jsx-tag-attribute-name": {
+ "match": "(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)",
+ "captures": {
+ "1": {
+ "name": "entity.other.attribute-name.namespace.js"
+ },
+ "2": {
+ "name": "punctuation.separator.namespace.js"
+ },
+ "3": {
+ "name": "entity.other.attribute-name.js"
+ }
+ }
+ },
+ "jsx-tag-attribute-assignment": {
+ "name": "keyword.operator.assignment.js",
+ "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))"
+ },
+ "jsx-string-double-quoted": {
+ "name": "string.quoted.double.js",
+ "begin": "\"",
+ "end": "\"",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx-string-single-quoted": {
+ "name": "string.quoted.single.js",
+ "begin": "'",
+ "end": "'",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.definition.string.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx-tag-attributes-illegal": {
+ "name": "invalid.illegal.attribute.js",
+ "match": "\\S+"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/csharp.tmLanguage.json b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/csharp.tmLanguage.json
new file mode 100644
index 0000000000..4d80bcc364
--- /dev/null
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.Grammar.Test/embeddedGrammars/csharp.tmLanguage.json
@@ -0,0 +1,4333 @@
+{
+ "information_for_contributors": [
+ "This file has been converted from https://github.com/dotnet/csharp-tmLanguage/blob/master/grammars/csharp.tmLanguage",
+ "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/ad7514e8d78542a6ee37f6187091cd4102eb3797",
+ "name": "C#",
+ "scopeName": "source.cs",
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#directives"
+ },
+ {
+ "include": "#declarations"
+ },
+ {
+ "include": "#script-top-level"
+ }
+ ],
+ "repository": {
+ "directives": {
+ "patterns": [
+ {
+ "include": "#extern-alias-directive"
+ },
+ {
+ "include": "#using-directive"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "declarations": {
+ "patterns": [
+ {
+ "include": "#namespace-declaration"
+ },
+ {
+ "include": "#type-declarations"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "script-top-level": {
+ "patterns": [
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "include": "#statement"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "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": "#attribute-section"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "class-or-struct-members": {
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#storage-modifier"
+ },
+ {
+ "include": "#type-declarations"
+ },
+ {
+ "include": "#property-declaration"
+ },
+ {
+ "include": "#field-declaration"
+ },
+ {
+ "include": "#event-declaration"
+ },
+ {
+ "include": "#indexer-declaration"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#constructor-declaration"
+ },
+ {
+ "include": "#destructor-declaration"
+ },
+ {
+ "include": "#operator-declaration"
+ },
+ {
+ "include": "#conversion-operator-declaration"
+ },
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "interface-members": {
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#property-declaration"
+ },
+ {
+ "include": "#event-declaration"
+ },
+ {
+ "include": "#indexer-declaration"
+ },
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "statement": {
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#while-statement"
+ },
+ {
+ "include": "#do-statement"
+ },
+ {
+ "include": "#for-statement"
+ },
+ {
+ "include": "#foreach-statement"
+ },
+ {
+ "include": "#if-statement"
+ },
+ {
+ "include": "#else-part"
+ },
+ {
+ "include": "#switch-statement"
+ },
+ {
+ "include": "#goto-statement"
+ },
+ {
+ "include": "#return-statement"
+ },
+ {
+ "include": "#break-or-continue-statement"
+ },
+ {
+ "include": "#throw-statement"
+ },
+ {
+ "include": "#yield-statement"
+ },
+ {
+ "include": "#await-statement"
+ },
+ {
+ "include": "#try-statement"
+ },
+ {
+ "include": "#checked-unchecked-statement"
+ },
+ {
+ "include": "#lock-statement"
+ },
+ {
+ "include": "#using-statement"
+ },
+ {
+ "include": "#labeled-statement"
+ },
+ {
+ "include": "#local-declaration"
+ },
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "expression": {
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#checked-unchecked-expression"
+ },
+ {
+ "include": "#typeof-or-default-expression"
+ },
+ {
+ "include": "#nameof-expression"
+ },
+ {
+ "include": "#throw-expression"
+ },
+ {
+ "include": "#interpolated-string"
+ },
+ {
+ "include": "#verbatim-interpolated-string"
+ },
+ {
+ "include": "#this-or-base-expression"
+ },
+ {
+ "include": "#conditional-operator"
+ },
+ {
+ "include": "#expression-operators"
+ },
+ {
+ "include": "#await-expression"
+ },
+ {
+ "include": "#query-expression"
+ },
+ {
+ "include": "#as-expression"
+ },
+ {
+ "include": "#is-expression"
+ },
+ {
+ "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"
+ }
+ ]
+ },
+ "extern-alias-directive": {
+ "begin": "\\s*(extern)\\b\\s*(alias)\\b\\s*(@?[_[:alpha:]][_[:alnum:]]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.extern.cs"
+ },
+ "2": {
+ "name": "keyword.other.alias.cs"
+ },
+ "3": {
+ "name": "variable.other.alias.cs"
+ }
+ },
+ "end": "(?=;)"
+ },
+ "using-directive": {
+ "patterns": [
+ {
+ "begin": "\\b(using)\\b\\s+(static)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.using.cs"
+ },
+ "2": {
+ "name": "keyword.other.static.cs"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ {
+ "begin": "\\b(using)\\s+(?=(@?[_[:alpha:]][_[:alnum:]]*)\\s*=)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.using.cs"
+ },
+ "2": {
+ "name": "entity.name.type.alias.cs"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#operator-assignment"
+ }
+ ]
+ },
+ {
+ "begin": "\\b(using)\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.using.cs"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "entity.name.type.namespace.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "include": "#operator-assignment"
+ }
+ ]
+ }
+ ]
+ },
+ "attribute-section": {
+ "begin": "(\\[)(assembly|module|field|event|method|param|property|return|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"
+ }
+ ]
+ },
+ "attribute": {
+ "patterns": [
+ {
+ "include": "#type-name"
+ },
+ {
+ "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"
+ }
+ ]
+ },
+ "namespace-declaration": {
+ "begin": "\\b(namespace)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.namespace.cs"
+ }
+ },
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "entity.name.type.namespace.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "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"
+ }
+ ]
+ }
+ ]
+ },
+ "storage-modifier": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.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"
+ }
+ ]
+ },
+ "enum-declaration": {
+ "begin": "(?=\\benum\\b)",
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "begin": "(?=enum)",
+ "end": "(?=\\{)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.enum.cs"
+ },
+ "2": {
+ "name": "entity.name.type.enum.cs"
+ }
+ }
+ },
+ {
+ "begin": ":",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.separator.colon.cs"
+ }
+ },
+ "end": "(?=\\{)",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.open.cs"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "begin": "@?[_[:alpha:]][_[:alnum:]]*",
+ "beginCaptures": {
+ "0": {
+ "name": "entity.name.variable.enum-member.cs"
+ }
+ },
+ "end": "(?=(,|\\}))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ "interface-declaration": {
+ "begin": "(?=\\binterface\\b)",
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.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"
+ }
+ ]
+ },
+ "struct-declaration": {
+ "begin": "(?=\\bstruct\\b)",
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "begin": "(?x)\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.struct.cs"
+ },
+ "2": {
+ "name": "entity.name.type.struct.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": "#class-or-struct-members"
+ }
+ ]
+ },
+ {
+ "include": "#preprocessor"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ "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",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ }
+ }
+ },
+ {
+ "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b",
+ "captures": {
+ "1": {
+ "name": "entity.name.type.type-parameter.cs"
+ }
+ }
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#attribute-section"
+ }
+ ]
+ },
+ "base-types": {
+ "begin": ":",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.separator.colon.cs"
+ }
+ },
+ "end": "(?=\\{|where)",
+ "patterns": [
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#preprocessor"
+ }
+ ]
+ },
+ "generic-constraints": {
+ "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.where.cs"
+ },
+ "2": {
+ "name": "storage.type.cs"
+ },
+ "3": {
+ "name": "punctuation.separator.colon.cs"
+ }
+ },
+ "end": "(?=\\{|where|;|=>)",
+ "patterns": [
+ {
+ "name": "keyword.other.class.cs",
+ "match": "\\bclass\\b"
+ },
+ {
+ "name": "keyword.other.struct.cs",
+ "match": "\\bstruct\\b"
+ },
+ {
+ "match": "(new)\\s*(\\()\\s*(\\))",
+ "captures": {
+ "1": {
+ "name": "keyword.other.new.cs"
+ },
+ "2": {
+ "name": "punctuation.parenthesis.open.cs"
+ },
+ "3": {
+ "name": "punctuation.parenthesis.close.cs"
+ }
+ }
+ },
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#generic-constraints"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)",
+ "beginCaptures": {
+ "1": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "6": {
+ "name": "entity.name.variable.field.cs"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "name": "entity.name.variable.field.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#class-or-struct-members"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\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": "#expression-body"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#class-or-struct-members"
+ }
+ ]
+ },
+ "indexer-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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\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": "keyword.other.this.cs"
+ }
+ },
+ "end": "(?<=\\})|(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#bracketed-parameter-list"
+ },
+ {
+ "include": "#property-accessors"
+ },
+ {
+ "include": "#expression-body"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.event.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "8": {
+ "patterns": [
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#punctuation-accessor"
+ }
+ ]
+ },
+ "9": {
+ "patterns": [
+ {
+ "name": "entity.name.variable.event.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ }
+ },
+ "end": "(?<=\\})|(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#event-accessors"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "property-accessors": {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.open.cs"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.close.cs"
+ }
+ },
+ "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"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#expression-body"
+ },
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "event-accessors": {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.open.cs"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "name": "keyword.other.add.cs",
+ "match": "\\b(add)\\b"
+ },
+ {
+ "name": "keyword.other.remove.cs",
+ "match": "\\b(remove)\\b"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#expression-body"
+ },
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\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"
+ }
+ ]
+ },
+ "constructor-declaration": {
+ "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*\\s*\\()",
+ "end": "(?<=\\})|(?=;)",
+ "patterns": [
+ {
+ "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b",
+ "captures": {
+ "1": {
+ "name": "entity.name.function.cs"
+ }
+ }
+ },
+ {
+ "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": "keyword.other.base.cs"
+ },
+ "2": {
+ "name": "keyword.other.this.cs"
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#argument-list"
+ }
+ ]
+ },
+ "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"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?(?:\\b(?:operator)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "6": {
+ "name": "keyword.other.operator-decl.cs"
+ },
+ "7": {
+ "name": "entity.name.function.cs"
+ }
+ },
+ "end": "(?<=\\})|(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#parenthesized-parameter-list"
+ },
+ {
+ "include": "#expression-body"
+ },
+ {
+ "include": "#block"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "patterns": [
+ {
+ "match": "\\b(explicit)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.other.explicit.cs"
+ }
+ }
+ },
+ {
+ "match": "\\b(implicit)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.other.implicit.cs"
+ }
+ }
+ }
+ ]
+ },
+ "2": {
+ "name": "keyword.other.operator-decl.cs"
+ },
+ "3": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ },
+ "end": "(?<=\\})|(?=;)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#parenthesized-parameter-list"
+ },
+ {
+ "include": "#expression-body"
+ },
+ {
+ "include": "#block"
+ }
+ ]
+ },
+ "block": {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.open.cs"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.curlybrace.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#statement"
+ }
+ ]
+ },
+ "variable-initializer": {
+ "begin": "(?)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.assignment.cs"
+ }
+ },
+ "end": "(?=[,\\)\\];}])",
+ "patterns": [
+ {
+ "include": "#ref-modifier"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "expression-body": {
+ "begin": "=>",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.arrow.cs"
+ }
+ },
+ "end": "(?=[,\\);}])",
+ "patterns": [
+ {
+ "include": "#ref-modifier"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "goto-statement": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.other.var.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.local.cs"
+ },
+ "8": {
+ "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",
+ "captures": {
+ "1": {
+ "name": "keyword.other.var.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#tuple-declaration-deconstruction-element-list"
+ }
+ ]
+ },
+ "3": {
+ "name": "keyword.control.loop.in.cs"
+ }
+ }
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "include": "#statement"
+ }
+ ]
+ },
+ "try-statement": {
+ "patterns": [
+ {
+ "include": "#try-block"
+ },
+ {
+ "include": "#catch-clause"
+ },
+ {
+ "include": "#finally-clause"
+ }
+ ]
+ },
+ "try-block": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?:(\\g)\\b)?",
+ "captures": {
+ "1": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "6": {
+ "name": "entity.name.variable.local.cs"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "include": "#when-clause"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#block"
+ }
+ ]
+ },
+ "when-clause": {
+ "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 suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s*\n(?!=>)\n(?=,|;|=|\\))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ },
+ "2": {
+ "name": "storage.modifier.cs"
+ },
+ "3": {
+ "name": "keyword.other.var.cs"
+ },
+ "4": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "9": {
+ "name": "entity.name.variable.local.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "name": "entity.name.variable.local.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.local.cs"
+ }
+ },
+ "end": "(?=;)",
+ "patterns": [
+ {
+ "name": "entity.name.variable.local.cs",
+ "match": "@?[_[:alpha:]][_[:alnum:]]*"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "local-tuple-var-deconstruction": {
+ "begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?=;|=|\\))",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.var.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#tuple-declaration-deconstruction-element-list"
+ }
+ ]
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "tuple-deconstruction-assignment": {
+ "match": "(?x)\n(?\\s*\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)",
+ "captures": {
+ "1": {
+ "patterns": [
+ {
+ "include": "#tuple-deconstruction-element-list"
+ }
+ ]
+ }
+ }
+ },
+ "tuple-declaration-deconstruction-element-list": {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.parenthesis.open.cs"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.parenthesis.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#tuple-declaration-deconstruction-element-list"
+ },
+ {
+ "include": "#declaration-expression-tuple"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])",
+ "captures": {
+ "1": {
+ "name": "entity.name.variable.tuple-element.cs"
+ }
+ }
+ }
+ ]
+ },
+ "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"
+ },
+ {
+ "match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])",
+ "captures": {
+ "1": {
+ "name": "variable.other.readwrite.cs"
+ }
+ }
+ }
+ ]
+ },
+ "declaration-expression-local": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)\\]])",
+ "captures": {
+ "1": {
+ "name": "keyword.other.var.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.local.cs"
+ }
+ }
+ },
+ "declaration-expression-tuple": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)])",
+ "captures": {
+ "1": {
+ "name": "keyword.other.var.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.tuple-element.cs"
+ }
+ }
+ },
+ "checked-unchecked-expression": {
+ "begin": "(?>=|\\|="
+ },
+ {
+ "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.assignment.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": "\\?\\?"
+ }
+ ]
+ },
+ "conditional-operator": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(\\))(?=\\s*@?[_[:alnum:]\\(])",
+ "captures": {
+ "1": {
+ "name": "punctuation.parenthesis.open.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "punctuation.parenthesis.close.cs"
+ }
+ }
+ },
+ "as-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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?",
+ "captures": {
+ "1": {
+ "name": "keyword.other.as.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ }
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?",
+ "captures": {
+ "1": {
+ "name": "keyword.other.is.cs"
+ },
+ "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(?:(\\?)\\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"
+ },
+ "2": {
+ "name": "punctuation.accessor.cs"
+ },
+ "3": {
+ "name": "entity.name.function.cs"
+ },
+ "4": {
+ "patterns": [
+ {
+ "include": "#type-arguments"
+ }
+ ]
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#argument-list"
+ }
+ ]
+ },
+ "element-access-expression": {
+ "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"
+ },
+ "2": {
+ "name": "punctuation.accessor.cs"
+ },
+ "3": {
+ "name": "variable.other.object.property.cs"
+ },
+ "4": {
+ "name": "keyword.operator.null-conditional.cs"
+ }
+ },
+ "end": "(?<=\\])(?!\\s*\\[)",
+ "patterns": [
+ {
+ "include": "#bracketed-argument-list"
+ }
+ ]
+ },
+ "member-access-expression": {
+ "patterns": [
+ {
+ "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"
+ },
+ "2": {
+ "name": "punctuation.accessor.cs"
+ },
+ "3": {
+ "name": "variable.other.object.property.cs"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n(\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?\\s*<([^<>]|\\g)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
+ "captures": {
+ "1": {
+ "name": "punctuation.accessor.cs"
+ },
+ "2": {
+ "name": "variable.other.object.cs"
+ },
+ "3": {
+ "patterns": [
+ {
+ "include": "#type-arguments"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
+ "captures": {
+ "1": {
+ "name": "variable.other.object.cs"
+ }
+ }
+ }
+ ]
+ },
+ "object-creation-expression": {
+ "patterns": [
+ {
+ "include": "#object-creation-expression-with-parameters"
+ },
+ {
+ "include": "#object-creation-expression-with-no-parameters"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.new.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include": "#argument-list"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\{|$)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.new.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ }
+ },
+ "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*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\\s*\n(?=\\[)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.new.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ }
+ },
+ "end": "(?<=\\])",
+ "patterns": [
+ {
+ "include": "#bracketed-argument-list"
+ }
+ ]
+ },
+ "anonymous-object-creation-expression": {
+ "begin": "\\b(new)\\b\\s*(?=\\{|$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.other.new.cs"
+ }
+ },
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#initializer-expression"
+ }
+ ]
+ },
+ "bracketed-parameter-list": {
+ "begin": "(?=(\\[))",
+ "beginCaptures": {
+ "1": {
+ "name": "punctuation.squarebracket.open.cs"
+ }
+ },
+ "end": "(?=(\\]))",
+ "endCaptures": {
+ "1": {
+ "name": "punctuation.squarebracket.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(?<=\\[)",
+ "end": "(?=\\])",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#attribute-section"
+ },
+ {
+ "include": "#parameter"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ }
+ ]
+ },
+ "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"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)",
+ "captures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.parameter.cs"
+ }
+ }
+ },
+ "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"
+ }
+ ]
+ },
+ "bracketed-argument-list": {
+ "begin": "\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.squarebracket.open.cs"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.squarebracket.close.cs"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#named-argument"
+ },
+ {
+ "include": "#argument"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "named-argument": {
+ "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)",
+ "beginCaptures": {
+ "1": {
+ "name": "entity.name.variable.parameter.cs"
+ },
+ "2": {
+ "name": "punctuation.separator.colon.cs"
+ }
+ },
+ "end": "(?=(,|\\)|\\]))",
+ "patterns": [
+ {
+ "include": "#argument"
+ }
+ ]
+ },
+ "argument": {
+ "patterns": [
+ {
+ "name": "storage.modifier.cs",
+ "match": "\\b(ref|out|in)\\b"
+ },
+ {
+ "include": "#declaration-expression-local"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.from.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.range-variable.cs"
+ },
+ "8": {
+ "name": "keyword.query.in.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "query-body": {
+ "patterns": [
+ {
+ "include": "#let-clause"
+ },
+ {
+ "include": "#where-clause"
+ },
+ {
+ "include": "#join-clause"
+ },
+ {
+ "include": "#orderby-clause"
+ },
+ {
+ "include": "#select-clause"
+ },
+ {
+ "include": "#group-clause"
+ }
+ ]
+ },
+ "let-clause": {
+ "begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.let.cs"
+ },
+ "2": {
+ "name": "entity.name.variable.range-variable.cs"
+ },
+ "3": {
+ "name": "keyword.operator.assignment.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "where-clause": {
+ "begin": "(?x)\n\\b(where)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.where.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "join-clause": {
+ "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*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.join.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "7": {
+ "name": "entity.name.variable.range-variable.cs"
+ },
+ "8": {
+ "name": "keyword.query.in.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#join-on"
+ },
+ {
+ "include": "#join-equals"
+ },
+ {
+ "include": "#join-into"
+ },
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "join-on": {
+ "match": "\\b(on)\\b\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.query.on.cs"
+ }
+ }
+ },
+ "join-equals": {
+ "match": "\\b(equals)\\b\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.query.equals.cs"
+ }
+ }
+ },
+ "join-into": {
+ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.query.into.cs"
+ },
+ "2": {
+ "name": "entity.name.variable.range-variable.cs"
+ }
+ }
+ },
+ "orderby-clause": {
+ "begin": "\\b(orderby)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.orderby.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#ordering-direction"
+ },
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "ordering-direction": {
+ "match": "\\b(?:(ascending)|(descending))\\b",
+ "captures": {
+ "1": {
+ "name": "keyword.query.ascending.cs"
+ },
+ "2": {
+ "name": "keyword.query.descending.cs"
+ }
+ }
+ },
+ "select-clause": {
+ "begin": "\\b(select)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.select.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "group-clause": {
+ "begin": "\\b(group)\\b\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.query.group.cs"
+ }
+ },
+ "end": "(?=;|\\))",
+ "patterns": [
+ {
+ "include": "#group-by"
+ },
+ {
+ "include": "#group-into"
+ },
+ {
+ "include": "#query-body"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "group-by": {
+ "match": "\\b(by)\\b\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.query.by.cs"
+ }
+ }
+ },
+ "group-into": {
+ "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.query.into.cs"
+ },
+ "2": {
+ "name": "entity.name.variable.range-variable.cs"
+ }
+ }
+ },
+ "anonymous-method-expression": {
+ "patterns": [
+ {
+ "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ },
+ "2": {
+ "name": "entity.name.variable.parameter.cs"
+ },
+ "3": {
+ "name": "keyword.operator.arrow.cs"
+ }
+ },
+ "end": "(?=\\)|;|}|,)",
+ "patterns": [
+ {
+ "include": "#block"
+ },
+ {
+ "include": "#ref-modifier"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(\\(.*?\\))\\s*\n(=>)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.cs"
+ },
+ "2": {
+ "patterns": [
+ {
+ "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"
+ }
+ ]
+ }
+ ]
+ },
+ "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 (?