Skip to content

Commit

Permalink
Update js/ts grammars
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jan 25, 2019
1 parent ff58f50 commit 770beca
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 17 deletions.
77 changes: 73 additions & 4 deletions extensions/javascript/syntaxes/JavaScript.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +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/76cfeabda164d2d132222af72e0a5f991e26c51a",
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4",
"name": "JavaScript (with React support)",
"scopeName": "source.js",
"patterns": [
Expand Down Expand Up @@ -690,6 +690,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#object-binding-pattern"
},
Expand All @@ -712,6 +718,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#object-binding-pattern-const"
},
Expand Down Expand Up @@ -986,6 +998,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#parameter-object-binding-pattern"
},
Expand Down Expand Up @@ -2462,8 +2480,8 @@
},
{
"name": "meta.object.member.js meta.object-literal.key.js",
"begin": "(?=[\\'\\\"])",
"end": "(?=:)|((?<=[\\'\\\"])(?=\\s*[\\(\\<]))",
"begin": "(?=[\\'\\\"\\`])",
"end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))",
"patterns": [
{
"include": "#comment"
Expand All @@ -2473,9 +2491,22 @@
}
]
},
{
"name": "meta.object.member.js meta.object-literal.key.js",
"begin": "(?x)(?=(\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)))",
"end": "(?=:)|(?=\\s*([\\(\\<,}])|(\\s+as\\s+))",
"patterns": [
{
"include": "#comment"
},
{
"include": "#numeric-literal"
}
]
},
{
"name": "meta.method.declaration.js",
"begin": "(?<=[\\]\\'\\\"])(?=\\s*[\\(\\<])",
"begin": "(?<=[\\]\\'\\\"\\`])(?=\\s*[\\(\\<])",
"end": "(?=\\}|;|,)|(?<=\\})",
"patterns": [
{
Expand Down Expand Up @@ -2540,6 +2571,33 @@
}
}
},
{
"name": "meta.object.member.js",
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*([,}]|$))",
"captures": {
"1": {
"name": "keyword.control.as.js"
},
"2": {
"name": "storage.modifier.js"
}
}
},
{
"name": "meta.object.member.js",
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.control.as.js"
}
},
"end": "(?=$|^|[,}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+))",
"patterns": [
{
"include": "#type"
}
]
},
{
"name": "meta.object.member.js",
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)",
Expand Down Expand Up @@ -2958,6 +3016,17 @@
"name": "keyword.operator.expression.void.js",
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))void(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
},
{
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*($|[;,:})\\]]))",
"captures": {
"1": {
"name": "keyword.control.as.js"
},
"2": {
"name": "storage.modifier.js"
}
}
},
{
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+",
"beginCaptures": {
Expand Down
77 changes: 73 additions & 4 deletions extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +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/76cfeabda164d2d132222af72e0a5f991e26c51a",
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4",
"name": "JavaScript (with React support)",
"scopeName": "source.js.jsx",
"patterns": [
Expand Down Expand Up @@ -690,6 +690,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#object-binding-pattern"
},
Expand All @@ -712,6 +718,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#object-binding-pattern-const"
},
Expand Down Expand Up @@ -986,6 +998,12 @@
{
"include": "#string"
},
{
"include": "#numeric-literal"
},
{
"include": "#regex"
},
{
"include": "#parameter-object-binding-pattern"
},
Expand Down Expand Up @@ -2462,8 +2480,8 @@
},
{
"name": "meta.object.member.js.jsx meta.object-literal.key.js.jsx",
"begin": "(?=[\\'\\\"])",
"end": "(?=:)|((?<=[\\'\\\"])(?=\\s*[\\(\\<]))",
"begin": "(?=[\\'\\\"\\`])",
"end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as)\\s+))))",
"patterns": [
{
"include": "#comment"
Expand All @@ -2473,9 +2491,22 @@
}
]
},
{
"name": "meta.object.member.js.jsx meta.object-literal.key.js.jsx",
"begin": "(?x)(?=(\\b(?<!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?<!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?<!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$)))",
"end": "(?=:)|(?=\\s*([\\(\\<,}])|(\\s+as\\s+))",
"patterns": [
{
"include": "#comment"
},
{
"include": "#numeric-literal"
}
]
},
{
"name": "meta.method.declaration.js.jsx",
"begin": "(?<=[\\]\\'\\\"])(?=\\s*[\\(\\<])",
"begin": "(?<=[\\]\\'\\\"\\`])(?=\\s*[\\(\\<])",
"end": "(?=\\}|;|,)|(?<=\\})",
"patterns": [
{
Expand Down Expand Up @@ -2540,6 +2571,33 @@
}
}
},
{
"name": "meta.object.member.js.jsx",
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*([,}]|$))",
"captures": {
"1": {
"name": "keyword.control.as.js.jsx"
},
"2": {
"name": "storage.modifier.js.jsx"
}
}
},
{
"name": "meta.object.member.js.jsx",
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.control.as.js.jsx"
}
},
"end": "(?=$|^|[,}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+))",
"patterns": [
{
"include": "#type"
}
]
},
{
"name": "meta.object.member.js.jsx",
"begin": "(?=[_$[:alpha:]][_$[:alnum:]]*\\s*=)",
Expand Down Expand Up @@ -2958,6 +3016,17 @@
"name": "keyword.operator.expression.void.js.jsx",
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))void(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
},
{
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*($|[;,:})\\]]))",
"captures": {
"1": {
"name": "keyword.control.as.js.jsx"
},
"2": {
"name": "storage.modifier.js.jsx"
}
}
},
{
"begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+",
"beginCaptures": {
Expand Down
2 changes: 1 addition & 1 deletion extensions/typescript-basics/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"git": {
"name": "TypeScript-TmLanguage",
"repositoryUrl": "https://github.com/Microsoft/TypeScript-TmLanguage",
"commitHash": "76cfeabda164d2d132222af72e0a5f991e26c51a"
"commitHash": "444971648e9e1e41c54c62f41d1310f2816965c4"
}
},
"license": "MIT",
Expand Down
Loading

0 comments on commit 770beca

Please sign in to comment.