Skip to content

Commit

Permalink
Update grammars
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Sep 18, 2020
1 parent cddca5d commit 586b741
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 38 deletions.
85 changes: 61 additions & 24 deletions packages/languages/data/apex.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,17 @@
"match": "\\b(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size)\\b"
},
{
"match": "(?:(\\.))([[:alpha:]]+)(?=\\()",
"match": "(?:(\\??\\.))([[:alpha:]]+)(?=\\()",
"captures": {
"1": {
"name": "punctuation.accessor.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
},
"2": {
"name": "support.function.trigger.apex"
Expand Down Expand Up @@ -1013,13 +1020,20 @@
"include": "#trigger-context-declaration"
},
{
"match": "([_[:alpha:]][_[:alnum:]]*)(\\.)",
"match": "([_[:alpha:]][_[:alnum:]]*)(\\??\\.)",
"captures": {
"1": {
"name": "variable.other.object.apex"
},
"2": {
"name": "punctuation.accessor.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
}
}
},
Expand Down Expand Up @@ -1715,7 +1729,7 @@
]
},
"switch-statement": {
"begin": "(?x)\n(switch)\\b\\s+\n(on)\\b\\s+\n(?:([_.\\'\\(\\)[:alnum:]]+)\\s*)?\n(\\{)",
"begin": "(?x)\n(switch)\\b\\s+\n(on)\\b\\s+\n(?:([_.?\\'\\(\\)[:alnum:]]+)\\s*)?\n(\\{)",
"beginCaptures": {
"1": {
"name": "keyword.control.switch.apex"
Expand Down Expand Up @@ -2454,18 +2468,22 @@
}
},
"invocation-expression": {
"begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?<type-args>\\s*<([^<>]|\\g<type-args>)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list",
"begin": "(?x)\n(?:(\\??\\.)\\s*)? # safe navigator or accessor\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?<type-args>\\s*<([^<>]|\\g<type-args>)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list",
"beginCaptures": {
"1": {
"name": "keyword.operator.null-conditional.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
},
"2": {
"name": "punctuation.accessor.apex"
},
"3": {
"name": "entity.name.function.apex"
},
"4": {
"3": {
"patterns": [
{
"include": "#type-arguments"
Expand All @@ -2481,18 +2499,22 @@
]
},
"element-access-expression": {
"begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list",
"begin": "(?x)\n(?:(\\??\\.)\\s*)? # safe navigator or accessor\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list",
"beginCaptures": {
"1": {
"name": "keyword.operator.null-conditional.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
},
"2": {
"name": "punctuation.accessor.apex"
},
"3": {
"name": "variable.other.object.property.apex"
},
"4": {
"3": {
"name": "keyword.operator.null-conditional.apex"
}
},
Expand All @@ -2506,24 +2528,35 @@
"member-access-expression": {
"patterns": [
{
"match": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(\\.)\\s* # preceding dot\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[",
"match": "(?x)\n(\\??\\.)\\s* # safe navigator or accessor\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[",
"captures": {
"1": {
"name": "keyword.operator.null-conditional.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
},
"2": {
"name": "punctuation.accessor.apex"
},
"3": {
"name": "variable.other.object.property.apex"
}
}
},
{
"match": "(?x)\n(\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?<type-params>\\s*<([^<>]|\\g<type-params>)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
"match": "(?x)\n(\\??\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?<type-params>\\s*<([^<>]|\\g<type-params>)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)",
"captures": {
"1": {
"name": "punctuation.accessor.apex"
"patterns": [
{
"include": "#punctuation-accessor"
},
{
"include": "#operator-safe-navigation"
}
]
},
"2": {
"name": "variable.other.object.apex"
Expand Down Expand Up @@ -2871,6 +2904,10 @@
"name": "keyword.operator.assignment.apex",
"match": "(?<!=|!)(=)(?!=)"
},
"operator-safe-navigation": {
"name": "keyword.operator.safe-navigation.apex",
"match": "\\?\\."
},
"punctuation-comma": {
"name": "punctuation.separator.comma.apex",
"match": ","
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/javascript.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"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/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"name": "javascript",
"scopeName": "source.js",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/json.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/vscode-JSON.tmLanguage/blob/master/JSON.tmLanguage",
"This file has been converted from https://github.com/microsoft/vscode-JSON.tmLanguage/blob/master/JSON.tmLanguage",
"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/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
"version": "https://github.com/microsoft/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
"name": "json",
"scopeName": "source.json",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/jsonc.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/vscode-JSON.tmLanguage/blob/master/JSON.tmLanguage",
"This file has been converted from https://github.com/microsoft/vscode-JSON.tmLanguage/blob/master/JSON.tmLanguage",
"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/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
"version": "https://github.com/microsoft/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
"name": "jsonc",
"scopeName": "source.json.comments",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/jsx.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"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/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"name": "jsx",
"scopeName": "source.js.jsx",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/sql.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/vscode-mssql/blob/master/syntaxes/SQL.plist",
"This file has been converted from https://github.com/microsoft/vscode-mssql/blob/master/syntaxes/SQL.plist",
"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/vscode-mssql/commit/61ae0eb21ac53883a23e09913a5ae77a59126ff9",
"version": "https://github.com/microsoft/vscode-mssql/commit/61ae0eb21ac53883a23e09913a5ae77a59126ff9",
"name": "sql",
"scopeName": "source.sql",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/tsx.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage",
"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/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"name": "tsx",
"scopeName": "source.tsx",
"patterns": [
Expand Down
4 changes: 2 additions & 2 deletions packages/languages/data/typescript.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage",
"This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage",
"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/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"version": "https://github.com/microsoft/TypeScript-TmLanguage/commit/fa4e0d3a918db0eab8e5c5be952f3bd649968456",
"name": "typescript",
"scopeName": "source.ts",
"patterns": [
Expand Down

0 comments on commit 586b741

Please sign in to comment.