[typescript] update grammar

This commit is contained in:
Martin Aeschlimann
2016-11-08 21:47:31 +01:00
parent 1aaf1a8035
commit 147130799d
9 changed files with 1028 additions and 470 deletions

View File

@@ -6,8 +6,20 @@
],
"uuid": "ef98eb90-bf9b-11e4-bb52-0800200c9a66",
"patterns": [
{
"include": "#directives"
},
{
"include": "#statements"
},
{
"name": "comment.line.shebang.ts",
"match": "\\A(#!).*(?=$)",
"captures": {
"1": {
"name": "punctuation.definition.comment.ts"
}
}
}
],
"repository": {
@@ -16,9 +28,6 @@
{
"include": "#string"
},
{
"include": "#regex"
},
{
"include": "#template"
},
@@ -85,23 +94,48 @@
]
},
"var-single-variable": {
"name": "meta.var-single-variable.expr.ts",
"begin": "([_$[:alpha:]][_$[:alnum:]]*)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.ts"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
"name": "meta.var-single-variable.expr.ts",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))",
"beginCaptures": {
"1": {
"name": "entity.name.function.ts"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
},
{
"include": "#string"
},
{
"include": "#comment"
}
]
},
{
"include": "#string"
},
{
"include": "#comment"
"name": "meta.var-single-variable.expr.ts",
"begin": "([_$[:alpha:]][_$[:alnum:]]*)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.ts"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
},
{
"include": "#string"
},
{
"include": "#comment"
}
]
}
]
},
@@ -147,29 +181,14 @@
"include": "#comment"
},
{
"begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
"beginCaptures": {
"1": {
"name": "variable.object.property.ts"
},
"2": {
"name": "punctuation.destructuring.ts"
}
},
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(?=,|\\})",
"patterns": [
{
"include": "#object-binding-pattern"
"include": "#object-binding-element-propertyName"
},
{
"include": "#array-binding-pattern"
},
{
"name": "variable.other.readwrite.ts",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#variable-initializer"
"include": "#binding-element"
}
]
},
@@ -187,7 +206,28 @@
}
]
},
"array-binding-element": {
"object-binding-element-propertyName": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(:)",
"endCaptures": {
"0": {
"name": "punctuation.destructuring.ts"
}
},
"patterns": [
{
"include": "#string"
},
{
"include": "#array-literal"
},
{
"name": "variable.object.property.ts",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
}
]
},
"binding-element": {
"patterns": [
{
"include": "#comment"
@@ -203,9 +243,6 @@
},
{
"include": "#variable-initializer"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -260,7 +297,10 @@
},
"patterns": [
{
"include": "#array-binding-element"
"include": "#binding-element"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -338,10 +378,10 @@
"include": "#expression-operators"
},
{
"include": "#support-objects"
"include": "#function-call"
},
{
"include": "#function-call"
"include": "#support-objects"
},
{
"include": "#identifiers"
@@ -546,12 +586,15 @@
]
},
{
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")))",
"begin": "(?=((\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\])))",
"end": "(?=,|\\}|$)",
"patterns": [
{
"include": "#string"
},
{
"include": "#array-literal"
},
{
"include": "#comment"
},
@@ -908,7 +951,7 @@
"include": "#type-parameters"
},
{
"match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)",
"match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*([,<{]|extends|implements|//|/\\*))",
"captures": {
"1": {
"name": "entity.name.type.module.ts"
@@ -919,12 +962,15 @@
}
},
{
"match": "([_$[:alpha:]][_$[:alnum:]]*)",
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*([,<{]|extends|implements|//|/\\*))",
"captures": {
"1": {
"name": "entity.other.inherited-class.ts"
}
}
},
{
"include": "#expression"
}
]
},
@@ -1044,7 +1090,7 @@
},
"field-declaration": {
"name": "meta.field.declaration.ts",
"begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
"begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
"beginCaptures": {
"1": {
"name": "storage.modifier.ts"
@@ -1056,7 +1102,7 @@
"include": "#variable-initializer"
},
{
"begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
"begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
"end": "(?=[};,=]|$)|(?<=\\})",
"patterns": [
{
@@ -1071,6 +1117,10 @@
{
"include": "#comment"
},
{
"name": "entity.name.function.ts",
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))"
},
{
"name": "variable.object.property.ts",
"match": "[_$[:alpha:]][_$[:alnum:]]*"
@@ -1085,7 +1135,7 @@
},
"method-declaration": {
"name": "meta.method.declaration.ts",
"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*[\\(\\<]))",
"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.ts"
@@ -1135,7 +1185,7 @@
]
},
"method-overload-declaration": {
"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*[\\(\\<]))",
"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.ts"
@@ -1167,7 +1217,7 @@
]
},
"method-declaration-name": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\??)\\s*[\\(\\<])",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??)\\s*[\\(\\<])",
"end": "(?=\\(|\\<)",
"patterns": [
{
@@ -1339,24 +1389,48 @@
]
},
"parameter-name": {
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
"captures": {
"1": {
"name": "storage.modifier.ts"
"patterns": [
{
"match": "(?x)(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))",
"captures": {
"1": {
"name": "storage.modifier.ts"
},
"2": {
"name": "storage.modifier.ts"
},
"3": {
"name": "keyword.operator.rest.ts"
},
"4": {
"name": "entity.name.function.ts"
},
"5": {
"name": "keyword.operator.optional.ts"
}
}
},
"2": {
"name": "storage.modifier.ts"
},
"3": {
"name": "keyword.operator.rest.ts"
},
"4": {
"name": "variable.parameter.ts"
},
"5": {
"name": "keyword.operator.optional.ts"
{
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
"captures": {
"1": {
"name": "storage.modifier.ts"
},
"2": {
"name": "storage.modifier.ts"
},
"3": {
"name": "keyword.operator.rest.ts"
},
"4": {
"name": "variable.parameter.ts"
},
"5": {
"name": "keyword.operator.optional.ts"
}
}
}
}
]
},
"destructuring-parameter": {
"patterns": [
@@ -1396,7 +1470,10 @@
},
"patterns": [
{
"include": "#parameter-array-binding-element"
"include": "#parameter-binding-element"
},
{
"include": "#punctuation-comma"
}
]
}
@@ -1408,29 +1485,14 @@
"include": "#comment"
},
{
"begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
"beginCaptures": {
"1": {
"name": "variable.object.property.ts"
},
"2": {
"name": "punctuation.destructuring.ts"
}
},
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(?=,|\\})",
"patterns": [
{
"include": "#parameter-object-binding-pattern"
"include": "#object-binding-element-propertyName"
},
{
"include": "#parameter-array-binding-pattern"
},
{
"name": "variable.parameter.ts",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#variable-initializer"
"include": "#parameter-binding-element"
}
]
},
@@ -1448,7 +1510,7 @@
}
]
},
"parameter-array-binding-element": {
"parameter-binding-element": {
"patterns": [
{
"include": "#comment"
@@ -1464,9 +1526,6 @@
},
{
"include": "#variable-initializer"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -1521,7 +1580,10 @@
},
"patterns": [
{
"include": "#parameter-array-binding-element"
"include": "#parameter-binding-element"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -1681,9 +1743,9 @@
},
"type-paren-or-function-parameters": {
"name": "meta.type.paren.cover.ts",
"begin": "\\s*(\\()",
"begin": "\\(",
"beginCaptures": {
"1": {
"0": {
"name": "meta.brace.round.ts"
}
},
@@ -1740,7 +1802,7 @@
},
{
"name": "meta.type.function.ts",
"begin": "(?x)( \\s* (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
"begin": "(?x)( (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
"end": "(?<=\\))",
"patterns": [
{
@@ -1758,6 +1820,10 @@
{
"name": "keyword.operator.type.ts",
"match": "[&|]"
},
{
"name": "keyword.operator.expression.keyof.ts",
"match": "(?<!\\.|\\$)\\bkeyof\\b(?!\\$)"
}
]
},
@@ -2163,17 +2229,20 @@
]
},
"function-call": {
"begin": "(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"beginCaptures": {
"1": {
"name": "punctuation.accessor.ts"
},
"2": {
"name": "entity.name.function.ts"
}
},
"end": "(?<=\\))",
"begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"patterns": [
{
"include": "#support-objects"
},
{
"name": "punctuation.accessor.ts",
"match": "\\."
},
{
"name": "entity.name.function.ts",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#comment"
},
@@ -2312,6 +2381,9 @@
{
"include": "#paren-expression"
},
{
"include": "#class-or-interface-declaration"
},
{
"include": "#type"
}
@@ -2327,12 +2399,12 @@
},
{
"name": "meta.object.member.ts",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
"end": "(?=,|\\})",
"patterns": [
{
"name": "meta.object-literal.key.ts",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
"end": ":",
"endCaptures": {
"0": {
@@ -2515,6 +2587,14 @@
{
"name": "keyword.operator.arithmetic.ts",
"match": "%|\\*|/|-|\\+"
},
{
"match": "(?<=[_$[:alnum:]])\\s*(/)(?![/*])",
"captures": {
"1": {
"name": "keyword.operator.arithmetic.ts"
}
}
}
]
},
@@ -2686,7 +2766,7 @@
"patterns": [
{
"name": "string.regex.ts",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*+?])(?=.*/)",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.ts"
@@ -2875,7 +2955,6 @@
]
},
"string": {
"name": "string.ts",
"patterns": [
{
"include": "#qstring-single"
@@ -3082,8 +3161,13 @@
{
"name": "comment.block.documentation.ts",
"begin": "/\\*\\*(?!/)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.ts"
}
},
"end": "\\*/",
"captures": {
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.ts"
}
@@ -3097,8 +3181,13 @@
{
"name": "comment.block.ts",
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.ts"
}
},
"end": "\\*/",
"captures": {
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.ts"
}
@@ -3127,6 +3216,49 @@
}
]
},
"directives": {
"name": "comment.line.triple-slash.directive.ts",
"begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.ts"
}
},
"end": "(?=$)",
"patterns": [
{
"name": "meta.tag.ts",
"begin": "(<)(reference|amd-dependency|amd-module)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.directive.ts"
},
"2": {
"name": "entity.name.tag.directive.ts"
}
},
"end": "/>",
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.directive.ts"
}
},
"patterns": [
{
"name": "entity.other.attribute-name.directive.ts",
"match": "path|types|no-default-lib|name"
},
{
"name": "keyword.operator.assignment.ts",
"match": "="
},
{
"include": "#string"
}
]
}
]
},
"docblock": {
"patterns": [
{
@@ -3167,5 +3299,5 @@
]
}
},
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/578dd5db70333e3b6826ff529276f32916a2c81b"
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/4d0bdebb93aadc25ecbb903ebc897e9cd5fab69c"
}

View File

@@ -6,8 +6,20 @@
],
"uuid": "805375ec-d614-41f5-8993-5843fe63ea82",
"patterns": [
{
"include": "#directives"
},
{
"include": "#statements"
},
{
"name": "comment.line.shebang.ts",
"match": "\\A(#!).*(?=$)",
"captures": {
"1": {
"name": "punctuation.definition.comment.ts"
}
}
}
],
"repository": {
@@ -16,9 +28,6 @@
{
"include": "#string"
},
{
"include": "#regex"
},
{
"include": "#template"
},
@@ -85,23 +94,48 @@
]
},
"var-single-variable": {
"name": "meta.var-single-variable.expr.tsx",
"begin": "([_$[:alpha:]][_$[:alnum:]]*)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.tsx"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
"name": "meta.var-single-variable.expr.tsx",
"begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))",
"beginCaptures": {
"1": {
"name": "entity.name.function.tsx"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
},
{
"include": "#string"
},
{
"include": "#comment"
}
]
},
{
"include": "#string"
},
{
"include": "#comment"
"name": "meta.var-single-variable.expr.tsx",
"begin": "([_$[:alpha:]][_$[:alnum:]]*)",
"beginCaptures": {
"1": {
"name": "variable.other.readwrite.tsx"
}
},
"end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
"patterns": [
{
"include": "#type-annotation"
},
{
"include": "#string"
},
{
"include": "#comment"
}
]
}
]
},
@@ -147,29 +181,14 @@
"include": "#comment"
},
{
"begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
"beginCaptures": {
"1": {
"name": "variable.object.property.tsx"
},
"2": {
"name": "punctuation.destructuring.tsx"
}
},
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(?=,|\\})",
"patterns": [
{
"include": "#object-binding-pattern"
"include": "#object-binding-element-propertyName"
},
{
"include": "#array-binding-pattern"
},
{
"name": "variable.other.readwrite.tsx",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#variable-initializer"
"include": "#binding-element"
}
]
},
@@ -187,7 +206,28 @@
}
]
},
"array-binding-element": {
"object-binding-element-propertyName": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(:)",
"endCaptures": {
"0": {
"name": "punctuation.destructuring.tsx"
}
},
"patterns": [
{
"include": "#string"
},
{
"include": "#array-literal"
},
{
"name": "variable.object.property.tsx",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
}
]
},
"binding-element": {
"patterns": [
{
"include": "#comment"
@@ -203,9 +243,6 @@
},
{
"include": "#variable-initializer"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -260,7 +297,10 @@
},
"patterns": [
{
"include": "#array-binding-element"
"include": "#binding-element"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -341,10 +381,10 @@
"include": "#expression-operators"
},
{
"include": "#support-objects"
"include": "#function-call"
},
{
"include": "#function-call"
"include": "#support-objects"
},
{
"include": "#identifiers"
@@ -549,12 +589,15 @@
]
},
{
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")))",
"begin": "(?=((\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\])))",
"end": "(?=,|\\}|$)",
"patterns": [
{
"include": "#string"
},
{
"include": "#array-literal"
},
{
"include": "#comment"
},
@@ -911,7 +954,7 @@
"include": "#type-parameters"
},
{
"match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)",
"match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*([,<{]|extends|implements|//|/\\*))",
"captures": {
"1": {
"name": "entity.name.type.module.tsx"
@@ -922,12 +965,15 @@
}
},
{
"match": "([_$[:alpha:]][_$[:alnum:]]*)",
"match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*([,<{]|extends|implements|//|/\\*))",
"captures": {
"1": {
"name": "entity.other.inherited-class.tsx"
}
}
},
{
"include": "#expression"
}
]
},
@@ -1047,7 +1093,7 @@
},
"field-declaration": {
"name": "meta.field.declaration.tsx",
"begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
"begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
"beginCaptures": {
"1": {
"name": "storage.modifier.tsx"
@@ -1059,7 +1105,7 @@
"include": "#variable-initializer"
},
{
"begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
"begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
"end": "(?=[};,=]|$)|(?<=\\})",
"patterns": [
{
@@ -1074,6 +1120,10 @@
{
"include": "#comment"
},
{
"name": "entity.name.function.tsx",
"match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))"
},
{
"name": "variable.object.property.tsx",
"match": "[_$[:alpha:]][_$[:alnum:]]*"
@@ -1088,7 +1138,7 @@
},
"method-declaration": {
"name": "meta.method.declaration.tsx",
"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*[\\(\\<]))",
"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.tsx"
@@ -1138,7 +1188,7 @@
]
},
"method-overload-declaration": {
"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*[\\(\\<]))",
"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.tsx"
@@ -1170,7 +1220,7 @@
]
},
"method-declaration-name": {
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\??)\\s*[\\(\\<])",
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??)\\s*[\\(\\<])",
"end": "(?=\\(|\\<)",
"patterns": [
{
@@ -1342,24 +1392,48 @@
]
},
"parameter-name": {
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
"captures": {
"1": {
"name": "storage.modifier.tsx"
"patterns": [
{
"match": "(?x)(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))",
"captures": {
"1": {
"name": "storage.modifier.tsx"
},
"2": {
"name": "storage.modifier.tsx"
},
"3": {
"name": "keyword.operator.rest.tsx"
},
"4": {
"name": "entity.name.function.tsx"
},
"5": {
"name": "keyword.operator.optional.tsx"
}
}
},
"2": {
"name": "storage.modifier.tsx"
},
"3": {
"name": "keyword.operator.rest.tsx"
},
"4": {
"name": "variable.parameter.tsx"
},
"5": {
"name": "keyword.operator.optional.tsx"
{
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
"captures": {
"1": {
"name": "storage.modifier.tsx"
},
"2": {
"name": "storage.modifier.tsx"
},
"3": {
"name": "keyword.operator.rest.tsx"
},
"4": {
"name": "variable.parameter.tsx"
},
"5": {
"name": "keyword.operator.optional.tsx"
}
}
}
}
]
},
"destructuring-parameter": {
"patterns": [
@@ -1399,7 +1473,10 @@
},
"patterns": [
{
"include": "#parameter-array-binding-element"
"include": "#parameter-binding-element"
},
{
"include": "#punctuation-comma"
}
]
}
@@ -1411,29 +1488,14 @@
"include": "#comment"
},
{
"begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
"beginCaptures": {
"1": {
"name": "variable.object.property.tsx"
},
"2": {
"name": "punctuation.destructuring.tsx"
}
},
"begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
"end": "(?=,|\\})",
"patterns": [
{
"include": "#parameter-object-binding-pattern"
"include": "#object-binding-element-propertyName"
},
{
"include": "#parameter-array-binding-pattern"
},
{
"name": "variable.parameter.tsx",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#variable-initializer"
"include": "#parameter-binding-element"
}
]
},
@@ -1451,7 +1513,7 @@
}
]
},
"parameter-array-binding-element": {
"parameter-binding-element": {
"patterns": [
{
"include": "#comment"
@@ -1467,9 +1529,6 @@
},
{
"include": "#variable-initializer"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -1524,7 +1583,10 @@
},
"patterns": [
{
"include": "#parameter-array-binding-element"
"include": "#parameter-binding-element"
},
{
"include": "#punctuation-comma"
}
]
},
@@ -1684,9 +1746,9 @@
},
"type-paren-or-function-parameters": {
"name": "meta.type.paren.cover.tsx",
"begin": "\\s*(\\()",
"begin": "\\(",
"beginCaptures": {
"1": {
"0": {
"name": "meta.brace.round.tsx"
}
},
@@ -1743,7 +1805,7 @@
},
{
"name": "meta.type.function.tsx",
"begin": "(?x)( \\s* (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
"begin": "(?x)( (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
"end": "(?<=\\))",
"patterns": [
{
@@ -1761,6 +1823,10 @@
{
"name": "keyword.operator.type.tsx",
"match": "[&|]"
},
{
"name": "keyword.operator.expression.keyof.tsx",
"match": "(?<!\\.|\\$)\\bkeyof\\b(?!\\$)"
}
]
},
@@ -2166,17 +2232,20 @@
]
},
"function-call": {
"begin": "(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"beginCaptures": {
"1": {
"name": "punctuation.accessor.tsx"
},
"2": {
"name": "entity.name.function.tsx"
}
},
"end": "(?<=\\))",
"begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"patterns": [
{
"include": "#support-objects"
},
{
"name": "punctuation.accessor.tsx",
"match": "\\."
},
{
"name": "entity.name.function.tsx",
"match": "([_$[:alpha:]][_$[:alnum:]]*)"
},
{
"include": "#comment"
},
@@ -2302,6 +2371,9 @@
{
"include": "#paren-expression"
},
{
"include": "#class-or-interface-declaration"
},
{
"include": "#type"
}
@@ -2317,12 +2389,12 @@
},
{
"name": "meta.object.member.tsx",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
"end": "(?=,|\\})",
"patterns": [
{
"name": "meta.object-literal.key.tsx",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
"begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
"end": ":",
"endCaptures": {
"0": {
@@ -2505,6 +2577,14 @@
{
"name": "keyword.operator.arithmetic.tsx",
"match": "%|\\*|/|-|\\+"
},
{
"match": "(?<=[_$[:alnum:]])\\s*(/)(?![/*])",
"captures": {
"1": {
"name": "keyword.operator.arithmetic.tsx"
}
}
}
]
},
@@ -2676,7 +2756,7 @@
"patterns": [
{
"name": "string.regex.tsx",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*+?])(?=.*/)",
"begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.string.begin.tsx"
@@ -2865,7 +2945,6 @@
]
},
"string": {
"name": "string.tsx",
"patterns": [
{
"include": "#qstring-single"
@@ -3072,8 +3151,13 @@
{
"name": "comment.block.documentation.tsx",
"begin": "/\\*\\*(?!/)",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.tsx"
}
},
"end": "\\*/",
"captures": {
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.tsx"
}
@@ -3087,8 +3171,13 @@
{
"name": "comment.block.tsx",
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.tsx"
}
},
"end": "\\*/",
"captures": {
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.tsx"
}
@@ -3117,6 +3206,49 @@
}
]
},
"directives": {
"name": "comment.line.triple-slash.directive.tsx",
"begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.tsx"
}
},
"end": "(?=$)",
"patterns": [
{
"name": "meta.tag.tsx",
"begin": "(<)(reference|amd-dependency|amd-module)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.directive.tsx"
},
"2": {
"name": "entity.name.tag.directive.tsx"
}
},
"end": "/>",
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.directive.tsx"
}
},
"patterns": [
{
"name": "entity.other.attribute-name.directive.tsx",
"match": "path|types|no-default-lib|name"
},
{
"name": "keyword.operator.assignment.tsx",
"match": "="
},
{
"include": "#string"
}
]
}
]
},
"docblock": {
"patterns": [
{
@@ -3176,7 +3308,6 @@
]
},
"jsx-tag-attribute-name": {
"name": "meta.tag.attribute-name.tsx",
"match": "(?x)\n \\s*\n ([_$a-zA-Z][-$\\w]*)\n (?=\\s|=|/?>|/\\*|//)",
"captures": {
"1": {
@@ -3189,42 +3320,42 @@
"match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))"
},
"jsx-string-double-quoted": {
"name": "string.jsxAttributeValue.quoted.double.tsx",
"name": "string.quoted.double.tsx",
"begin": "\"",
"end": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.jsxAttributeValue.begin.tsx"
"name": "punctuation.definition.string.begin.tsx"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.jsxAttributeValue.end.tsx"
"name": "punctuation.definition.string.end.tsx"
}
},
"patterns": [
{
"include": "#jsx-attributeValue-entities"
"include": "#jsx-entities"
}
]
},
"jsx-string-single-quoted": {
"name": "string.jsxAttributeValue.quoted.single.tsx",
"name": "string.quoted.single.tsx",
"begin": "'",
"end": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.jsxAttributeValue.begin.tsx"
"name": "punctuation.definition.string.begin.tsx"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.jsxAttributeValue.end.tsx"
"name": "punctuation.definition.string.end.tsx"
}
},
"patterns": [
{
"include": "#jsx-attributeValue-entities"
"include": "#jsx-entities"
}
]
},
@@ -3248,26 +3379,6 @@
}
]
},
"jsx-attributeValue-entities": {
"patterns": [
{
"name": "constant.character.entity.jsxAttributeValue.tsx",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"captures": {
"1": {
"name": "punctuation.definition.entity.jsxAttributeValue.tsx"
},
"3": {
"name": "punctuation.definition.entity.jsxAttributeValue.tsx"
}
}
},
{
"name": "invalid.illegal.bad-ampersand.jsxAttributeValue.tsx",
"match": "&"
}
]
},
"jsx-evaluated-code": {
"name": "meta.embedded.expression.tsx",
"begin": "{",
@@ -3459,5 +3570,5 @@
]
}
},
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/578dd5db70333e3b6826ff529276f32916a2c81b"
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/4d0bdebb93aadc25ecbb903ebc897e9cd5fab69c"
}