mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
[typescript] update grammar to to Microsoft/TypeScript-TmLanguage@e47681d (2017-01-17). Fixes #18612
This commit is contained in:
@@ -34,9 +34,6 @@
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#declaration"
|
||||
},
|
||||
@@ -106,13 +103,7 @@
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -124,7 +115,12 @@
|
||||
"name": "variable.other.constant.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))"
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.var-single-variable.expr.ts",
|
||||
@@ -137,18 +133,25 @@
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"var-single-variable-type-annotation": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"destructuring-variable": {
|
||||
"patterns": [
|
||||
{
|
||||
@@ -334,7 +337,6 @@
|
||||
]
|
||||
},
|
||||
"expression": {
|
||||
"name": "meta.expression.ts",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
@@ -349,10 +351,7 @@
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#function-declaration"
|
||||
"include": "#function-expression"
|
||||
},
|
||||
{
|
||||
"include": "#class-or-interface-declaration"
|
||||
@@ -378,6 +377,9 @@
|
||||
{
|
||||
"include": "#function-call"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#support-objects"
|
||||
},
|
||||
@@ -409,17 +411,6 @@
|
||||
"name": "keyword.control.flow.ts",
|
||||
"match": "(?<!\\.|\\$)\\b(return)\\b(?!\\$)"
|
||||
},
|
||||
{
|
||||
"match": "(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.flow.ts"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.generator.asterisk.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.switch.ts",
|
||||
"match": "(?<!\\.|\\$)\\b(case|default|switch)\\b(?!\\$)"
|
||||
@@ -443,7 +434,6 @@
|
||||
]
|
||||
},
|
||||
"declaration": {
|
||||
"name": "meta.declaration.ts",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#decorator"
|
||||
@@ -880,7 +870,7 @@
|
||||
},
|
||||
"class-or-interface-declaration": {
|
||||
"name": "meta.class.ts",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b(?=\\s+|/[/*])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.export.ts"
|
||||
@@ -1350,7 +1340,43 @@
|
||||
"name": "entity.name.function.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|;|\\})|(?<=\\})",
|
||||
"end": "(?=$|;)|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#return-type"
|
||||
},
|
||||
{
|
||||
"include": "#decl-block"
|
||||
}
|
||||
]
|
||||
},
|
||||
"function-expression": {
|
||||
"name": "meta.function.expression.ts",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.ts"
|
||||
},
|
||||
"2": {
|
||||
"name": "storage.type.function.ts"
|
||||
},
|
||||
"3": {
|
||||
"name": "keyword.generator.asterisk.ts"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1638,7 +1664,7 @@
|
||||
"name": "keyword.operator.type.annotation.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?<!:)((?=$)|(?=\\{|;|//|\\}))",
|
||||
"end": "(?<!:)((?=$)|(?=[{};,]|//))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1694,7 +1720,6 @@
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"name": "meta.type.ts",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1833,16 +1858,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.type.function.ts",
|
||||
"begin": "(?<=\\>)\\s*(?=\\()",
|
||||
"end": "(?<=\\))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.type.function.ts",
|
||||
"begin": "(?x)(\n (?=\n [(]\\s*(\n ([)]) | \n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )\n )\n)",
|
||||
@@ -2293,12 +2308,18 @@
|
||||
]
|
||||
},
|
||||
"function-call": {
|
||||
"begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#support-objects"
|
||||
},
|
||||
{
|
||||
"include": "#object-identifiers"
|
||||
},
|
||||
{
|
||||
"include": "#punctuation-accessor"
|
||||
},
|
||||
@@ -2340,22 +2361,7 @@
|
||||
"identifiers": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.class.ts",
|
||||
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.accessor.ts"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.constant.object.property.ts"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.object.property.ts"
|
||||
}
|
||||
}
|
||||
"include": "#object-identifiers"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n (async\\s+)|(function\\s*[(<])|(function\\s+)|\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))",
|
||||
@@ -2390,6 +2396,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "variable.other.constant.ts",
|
||||
"match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
|
||||
},
|
||||
{
|
||||
"name": "variable.other.readwrite.ts",
|
||||
"match": "[_$[:alpha:]][_$[:alnum:]]*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"object-identifiers": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.class.ts",
|
||||
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.accessor.ts"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.constant.object.property.ts"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.object.property.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
@@ -2400,14 +2436,6 @@
|
||||
"name": "variable.other.object.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "variable.other.constant.ts",
|
||||
"match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
|
||||
},
|
||||
{
|
||||
"name": "variable.other.readwrite.ts",
|
||||
"match": "[_$[:alpha:]][_$[:alnum:]]*"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2562,6 +2590,17 @@
|
||||
"name": "keyword.control.flow.ts",
|
||||
"match": "(?<!\\.|\\$)\\b(await)\\b(?!\\$)"
|
||||
},
|
||||
{
|
||||
"match": "(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.flow.ts"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.generator.asterisk.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.delete.ts",
|
||||
"match": "(?<!\\.|\\$)\\bdelete\\b(?!\\$)"
|
||||
@@ -2681,13 +2720,13 @@
|
||||
},
|
||||
{
|
||||
"name": "meta.arrow.ts",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)(?=\\s*[<(])\n) | (\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ([_$[:alpha:]][_$[:alnum:]]*\\s*:) | # [(]param:\n (\\.\\.\\.) # [(]...\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\n (\n (\\s+extends\\s*[^=>]) | # < typeparam extends \n (\\s*[,]) # < typeparam,\n )\n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>]|\\<[^<>]+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)(?=\\s*[<(])\n) | ((?<![})\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ([_$[:alpha:]][_$[:alnum:]]*\\s*:) | # [(]param:\n (\\.\\.\\.) # [(]...\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?==>)",
|
||||
"end": "(?==>|\\{)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -2731,8 +2770,28 @@
|
||||
"name": "keyword.operator.type.annotation.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?<!:)((?=$)|(?==>|;|//))",
|
||||
"end": "(?==>|\\{)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.object.type.ts",
|
||||
"begin": "(?<=:)\\s*(\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.block.ts"
|
||||
}
|
||||
},
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.block.ts"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-object-members"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#type-predicate-operator"
|
||||
},
|
||||
@@ -3074,7 +3133,6 @@
|
||||
]
|
||||
},
|
||||
"literal": {
|
||||
"name": "literal.ts",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#numeric-literal"
|
||||
@@ -3376,5 +3434,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f97fcdbb2f80123605982ca63b9ba68bb837df87"
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/e47681d06a4db46d286c53b14ab0a5ab17e71cd8"
|
||||
}
|
||||
@@ -34,9 +34,6 @@
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#declaration"
|
||||
},
|
||||
@@ -106,13 +103,7 @@
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -124,7 +115,12 @@
|
||||
"name": "variable.other.constant.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))"
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.var-single-variable.expr.tsx",
|
||||
@@ -137,18 +133,25 @@
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"var-single-variable-type-annotation": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"destructuring-variable": {
|
||||
"patterns": [
|
||||
{
|
||||
@@ -334,7 +337,6 @@
|
||||
]
|
||||
},
|
||||
"expression": {
|
||||
"name": "meta.expression.tsx",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#jsx"
|
||||
@@ -352,10 +354,7 @@
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#function-declaration"
|
||||
"include": "#function-expression"
|
||||
},
|
||||
{
|
||||
"include": "#class-or-interface-declaration"
|
||||
@@ -381,6 +380,9 @@
|
||||
{
|
||||
"include": "#function-call"
|
||||
},
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#support-objects"
|
||||
},
|
||||
@@ -412,17 +414,6 @@
|
||||
"name": "keyword.control.flow.tsx",
|
||||
"match": "(?<!\\.|\\$)\\b(return)\\b(?!\\$)"
|
||||
},
|
||||
{
|
||||
"match": "(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.flow.tsx"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.generator.asterisk.tsx"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.switch.tsx",
|
||||
"match": "(?<!\\.|\\$)\\b(case|default|switch)\\b(?!\\$)"
|
||||
@@ -446,7 +437,6 @@
|
||||
]
|
||||
},
|
||||
"declaration": {
|
||||
"name": "meta.declaration.tsx",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#decorator"
|
||||
@@ -883,7 +873,7 @@
|
||||
},
|
||||
"class-or-interface-declaration": {
|
||||
"name": "meta.class.tsx",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b(?=\\s+|/[/*])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.export.tsx"
|
||||
@@ -1353,7 +1343,43 @@
|
||||
"name": "entity.name.function.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|;|\\})|(?<=\\})",
|
||||
"end": "(?=$|;)|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#return-type"
|
||||
},
|
||||
{
|
||||
"include": "#decl-block"
|
||||
}
|
||||
]
|
||||
},
|
||||
"function-expression": {
|
||||
"name": "meta.function.expression.tsx",
|
||||
"begin": "(?<!\\.|\\$)\\b(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.tsx"
|
||||
},
|
||||
"2": {
|
||||
"name": "storage.type.function.tsx"
|
||||
},
|
||||
"3": {
|
||||
"name": "keyword.generator.asterisk.tsx"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1641,7 +1667,7 @@
|
||||
"name": "keyword.operator.type.annotation.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<!:)((?=$)|(?=\\{|;|//|\\}))",
|
||||
"end": "(?<!:)((?=$)|(?=[{};,]|//))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1697,7 +1723,6 @@
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"name": "meta.type.tsx",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1836,16 +1861,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.type.function.tsx",
|
||||
"begin": "(?<=\\>)\\s*(?=\\()",
|
||||
"end": "(?<=\\))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.type.function.tsx",
|
||||
"begin": "(?x)(\n (?=\n [(]\\s*(\n ([)]) | \n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )\n )\n)",
|
||||
@@ -2296,12 +2311,18 @@
|
||||
]
|
||||
},
|
||||
"function-call": {
|
||||
"begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"end": "(?<=\\))(?!(([_$[:alpha:]][_$[:alnum:]]*\\s*\\.\\s*)*|(\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#literal"
|
||||
},
|
||||
{
|
||||
"include": "#support-objects"
|
||||
},
|
||||
{
|
||||
"include": "#object-identifiers"
|
||||
},
|
||||
{
|
||||
"include": "#punctuation-accessor"
|
||||
},
|
||||
@@ -2343,22 +2364,7 @@
|
||||
"identifiers": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.class.tsx",
|
||||
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.accessor.tsx"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.constant.object.property.tsx"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.object.property.tsx"
|
||||
}
|
||||
}
|
||||
"include": "#object-identifiers"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n (async\\s+)|(function\\s*[(<])|(function\\s+)|\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))",
|
||||
@@ -2393,6 +2399,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "variable.other.constant.tsx",
|
||||
"match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
|
||||
},
|
||||
{
|
||||
"name": "variable.other.readwrite.tsx",
|
||||
"match": "[_$[:alpha:]][_$[:alnum:]]*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"object-identifiers": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.class.tsx",
|
||||
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))"
|
||||
},
|
||||
{
|
||||
"match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.accessor.tsx"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.constant.object.property.tsx"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.object.property.tsx"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
|
||||
"captures": {
|
||||
@@ -2403,14 +2439,6 @@
|
||||
"name": "variable.other.object.tsx"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "variable.other.constant.tsx",
|
||||
"match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
|
||||
},
|
||||
{
|
||||
"name": "variable.other.readwrite.tsx",
|
||||
"match": "[_$[:alpha:]][_$[:alnum:]]*"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2552,6 +2580,17 @@
|
||||
"name": "keyword.control.flow.tsx",
|
||||
"match": "(?<!\\.|\\$)\\b(await)\\b(?!\\$)"
|
||||
},
|
||||
{
|
||||
"match": "(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.flow.tsx"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.generator.asterisk.tsx"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.delete.tsx",
|
||||
"match": "(?<!\\.|\\$)\\bdelete\\b(?!\\$)"
|
||||
@@ -2671,13 +2710,13 @@
|
||||
},
|
||||
{
|
||||
"name": "meta.arrow.tsx",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)(?=\\s*[<(])\n) | (\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ([_$[:alpha:]][_$[:alnum:]]*\\s*:) | # [(]param:\n (\\.\\.\\.) # [(]...\n )\n ) |\n (\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\n (\n (\\s+extends\\s*[^=>]) | # < typeparam extends \n (\\s*[,]) # < typeparam,\n )\n ) |\n # arrow function possible to detect only with => on same line\n (\n (<([^<>]|\\<[^<>]+\\>)+>\\s*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)(?=\\s*[<(])\n) | ((?<![})\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\s*\n (\n ([)]\\s*:) | # ():\n ([_$[:alpha:]][_$[:alnum:]]*\\s*:) | # [(]param:\n (\\.\\.\\.) # [(]...\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?==>)",
|
||||
"end": "(?==>|\\{)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -2721,8 +2760,28 @@
|
||||
"name": "keyword.operator.type.annotation.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<!:)((?=$)|(?==>|;|//))",
|
||||
"end": "(?==>|\\{)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.object.type.tsx",
|
||||
"begin": "(?<=:)\\s*(\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.block.tsx"
|
||||
}
|
||||
},
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.block.tsx"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-object-members"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#type-predicate-operator"
|
||||
},
|
||||
@@ -3064,7 +3123,6 @@
|
||||
]
|
||||
},
|
||||
"literal": {
|
||||
"name": "literal.tsx",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#numeric-literal"
|
||||
@@ -3647,5 +3705,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f97fcdbb2f80123605982ca63b9ba68bb837df87"
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/e47681d06a4db46d286c53b14ab0a5ab17e71cd8"
|
||||
}
|
||||
Reference in New Issue
Block a user