mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 04:36:23 +00:00
[typescript] update grammar
This commit is contained in:
committed by
Dirk Baeumer
parent
3785324cc1
commit
d889de5bb5
@@ -74,7 +74,7 @@
|
||||
"name": "storage.type.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|;|}|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|;|}|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#destructuring-variable"
|
||||
@@ -103,7 +103,7 @@
|
||||
"name": "meta.definition.variable.js entity.name.function.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
@@ -118,7 +118,7 @@
|
||||
"name": "meta.definition.variable.js variable.other.constant.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
@@ -133,7 +133,7 @@
|
||||
"name": "meta.definition.variable.js variable.other.readwrite.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#var-single-variable-type-annotation"
|
||||
@@ -160,7 +160,7 @@
|
||||
{
|
||||
"name": "meta.object-binding-pattern-variable.js",
|
||||
"begin": "(?<!=|:|of|in)\\s*(?=\\{)",
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#object-binding-pattern"
|
||||
@@ -176,7 +176,7 @@
|
||||
{
|
||||
"name": "meta.array-binding-pattern-variable.js",
|
||||
"begin": "(?<!=|:|of|in)\\s*(?=\\[)",
|
||||
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#array-binding-pattern"
|
||||
@@ -1141,14 +1141,14 @@
|
||||
"name": "storage.modifier.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\}|;|,|$)|(?<=\\})",
|
||||
"end": "(?=\\}|;|,|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\?\\s*)?(=|:))))|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variable-initializer"
|
||||
},
|
||||
{
|
||||
"begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\?\\s*)?(=|:))",
|
||||
"end": "(?=[};,=]|$)|(?<=\\})",
|
||||
"end": "(?=[};,=]|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\?\\s*)?(=|:))))|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-annotation"
|
||||
@@ -1179,50 +1179,93 @@
|
||||
]
|
||||
},
|
||||
"method-declaration": {
|
||||
"name": "meta.method.declaration.js",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|\\.|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\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.operator.new.js"
|
||||
},
|
||||
"6": {
|
||||
"name": "storage.type.js"
|
||||
},
|
||||
"7": {
|
||||
"name": "keyword.generator.asterisk.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\}|;|,|$)|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#method-declaration-name"
|
||||
"name": "meta.method.declaration.js",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\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": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#return-type"
|
||||
},
|
||||
{
|
||||
"include": "#decl-block"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#return-type"
|
||||
},
|
||||
{
|
||||
"include": "#decl-block"
|
||||
"name": "meta.method.declaration.js",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|\\.|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\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": "storage.type.js"
|
||||
},
|
||||
"6": {
|
||||
"name": "keyword.generator.asterisk.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\}|;|,|$)|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#method-declaration-name"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#function-parameters"
|
||||
},
|
||||
{
|
||||
"include": "#return-type"
|
||||
},
|
||||
{
|
||||
"include": "#decl-block"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1248,7 +1291,7 @@
|
||||
},
|
||||
"object-literal-method-declaration": {
|
||||
"name": "meta.method.declaration.js",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<])",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*[\\(\\<])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.js"
|
||||
@@ -1286,7 +1329,7 @@
|
||||
]
|
||||
},
|
||||
"object-literal-method-overload-declaration": {
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<])",
|
||||
"begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))\\s*[\\(\\<])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.js"
|
||||
@@ -1386,7 +1429,7 @@
|
||||
"name": "meta.definition.function.js entity.name.function.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|;)|(?<=\\})",
|
||||
"end": "(?=$|^|;)|(?<=\\})",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1710,7 +1753,7 @@
|
||||
"name": "keyword.operator.type.annotation.js"
|
||||
}
|
||||
},
|
||||
"end": "(?<![:|&])((?=$)|(?=[{};,]|//))",
|
||||
"end": "(?<![:|&])(?=$|^|[{};,]|//)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -1744,7 +1787,7 @@
|
||||
"name": "keyword.operator.type.annotation.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)",
|
||||
"end": "(?=$|^|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
@@ -2019,7 +2062,7 @@
|
||||
"name": "punctuation.definition.typeparameters.begin.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$)|(>)",
|
||||
"end": "(>)",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.typeparameters.end.js"
|
||||
@@ -2054,7 +2097,7 @@
|
||||
"name": "keyword.operator.assignment.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[,);}\\]])",
|
||||
"end": "(?=$|^|[,);}\\]])",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression"
|
||||
@@ -2693,7 +2736,7 @@
|
||||
"name": "keyword.control.as.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$|[;,:})\\]])",
|
||||
"end": "(?=$|^|[;,:})\\]])",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type"
|
||||
@@ -2778,7 +2821,7 @@
|
||||
},
|
||||
{
|
||||
"name": "meta.arrow.js",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"begin": "(?x) (?:\n (?<!\\.|\\$)(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.js"
|
||||
@@ -3358,25 +3401,17 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=//)",
|
||||
"begin": "(^[ \\t]+)?(//)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.js"
|
||||
},
|
||||
"2": {
|
||||
"name": "comment.line.double-slash.js punctuation.definition.comment.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "comment.line.double-slash.js",
|
||||
"begin": "//",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$)"
|
||||
}
|
||||
]
|
||||
"end": "(?=^)",
|
||||
"contentName": "comment.line.double-slash.tsx"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3388,7 +3423,7 @@
|
||||
"name": "punctuation.definition.comment.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=$)",
|
||||
"end": "(?=^)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.tag.js",
|
||||
@@ -4188,5 +4223,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/cb1af7953db224204607cbe22d3a45aa0f77a4c1"
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/8c967fe7553297bfad672b7417d78e357c8fe724"
|
||||
}
|
||||
Reference in New Issue
Block a user