Update js/ts grammar (#27957)
This commit is contained in:
parent
651409ec3c
commit
ab1e78ef1f
3 changed files with 43 additions and 22 deletions
|
@ -4,6 +4,7 @@
|
|||
"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/3a70fab1b03520774fa236f1f7e7a0939463739f",
|
||||
"name": "JavaScript (with React support)",
|
||||
"scopeName": "source.js",
|
||||
"fileTypes": [
|
||||
|
@ -1560,7 +1561,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.js"
|
||||
|
@ -1569,15 +1570,18 @@
|
|||
"name": "keyword.operator.rest.js"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.name.function.js"
|
||||
"name": "entity.name.function.js variable.language.this.js"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.js"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:((?<!\\.|\\$)\\bthis\\b(?!\\.|\\$))|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.js"
|
||||
|
@ -1586,9 +1590,12 @@
|
|||
"name": "keyword.operator.rest.js"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.parameter.js"
|
||||
"name": "variable.parameter.js variable.language.this.js"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.parameter.js"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.js"
|
||||
}
|
||||
}
|
||||
|
@ -2116,7 +2123,7 @@
|
|||
"name": "keyword.operator.assignment.js"
|
||||
}
|
||||
},
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)",
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(?<!=)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression"
|
||||
|
@ -2856,7 +2863,7 @@
|
|||
"name": "storage.type.function.arrow.js"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|((?!\\{)(?=\\S))",
|
||||
"end": "(?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#decl-block"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"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/3a70fab1b03520774fa236f1f7e7a0939463739f",
|
||||
"name": "TypeScript",
|
||||
"scopeName": "source.ts",
|
||||
"fileTypes": [
|
||||
|
@ -1554,7 +1555,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.ts"
|
||||
|
@ -1563,15 +1564,18 @@
|
|||
"name": "keyword.operator.rest.ts"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.name.function.ts"
|
||||
"name": "entity.name.function.ts variable.language.this.ts"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.ts"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:((?<!\\.|\\$)\\bthis\\b(?!\\.|\\$))|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.ts"
|
||||
|
@ -1580,9 +1584,12 @@
|
|||
"name": "keyword.operator.rest.ts"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.parameter.ts"
|
||||
"name": "variable.parameter.ts variable.language.this.ts"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.parameter.ts"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.ts"
|
||||
}
|
||||
}
|
||||
|
@ -2110,7 +2117,7 @@
|
|||
"name": "keyword.operator.assignment.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)",
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(?<!=)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression"
|
||||
|
@ -2541,9 +2548,9 @@
|
|||
"name": "meta.brace.angle.ts"
|
||||
}
|
||||
},
|
||||
"end": "\\>",
|
||||
"end": "(\\>)\\s*",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"1": {
|
||||
"name": "meta.brace.angle.ts"
|
||||
}
|
||||
},
|
||||
|
@ -2561,9 +2568,9 @@
|
|||
"name": "meta.brace.angle.ts"
|
||||
}
|
||||
},
|
||||
"end": "\\>",
|
||||
"end": "(\\>)\\s*",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"1": {
|
||||
"name": "meta.brace.angle.ts"
|
||||
}
|
||||
},
|
||||
|
@ -2887,7 +2894,7 @@
|
|||
"name": "storage.type.function.arrow.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|((?!\\{)(?=\\S))",
|
||||
"end": "(?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#decl-block"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"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/3a70fab1b03520774fa236f1f7e7a0939463739f",
|
||||
"name": "TypeScriptReact",
|
||||
"scopeName": "source.tsx",
|
||||
"fileTypes": [
|
||||
|
@ -1557,7 +1558,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)(?=\\s*\n (=\\s*(\n ((async\\s+)?(\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.tsx"
|
||||
|
@ -1566,15 +1567,18 @@
|
|||
"name": "keyword.operator.rest.tsx"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.name.function.tsx"
|
||||
"name": "entity.name.function.tsx variable.language.this.tsx"
|
||||
},
|
||||
"4": {
|
||||
"name": "entity.name.function.tsx"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.tsx"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
|
||||
"match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)(?:((?<!\\.|\\$)\\bthis\\b(?!\\.|\\$))|([_$[:alpha:]][_$[:alnum:]]*))\\s*(\\??)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.tsx"
|
||||
|
@ -1583,9 +1587,12 @@
|
|||
"name": "keyword.operator.rest.tsx"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.parameter.tsx"
|
||||
"name": "variable.parameter.tsx variable.language.this.tsx"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.parameter.tsx"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.operator.optional.tsx"
|
||||
}
|
||||
}
|
||||
|
@ -2113,7 +2120,7 @@
|
|||
"name": "keyword.operator.assignment.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)",
|
||||
"end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(?<!=)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression"
|
||||
|
@ -2853,7 +2860,7 @@
|
|||
"name": "storage.type.function.arrow.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|((?!\\{)(?=\\S))",
|
||||
"end": "(?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#decl-block"
|
||||
|
|
Loading…
Reference in a new issue