Patch js/ts grammars to remove special scopes for node

Fixes #94284

Now the we have semantic highlighting, we should use that to identify if a variable is really from node or not
This commit is contained in:
Matt Bierner
2020-04-03 14:11:47 -07:00
parent a1d80c4a70
commit 75c625d421
5 changed files with 18 additions and 113 deletions

View File

@@ -3617,30 +3617,6 @@
}
}
},
{
"name": "support.class.node.js.jsx",
"match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream\n |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b(?!\\$)"
},
{
"match": "(?x)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(process)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?:\n (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)\n |\n (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)\n))?\\b(?!\\$)",
"captures": {
"1": {
"name": "support.variable.object.process.js.jsx"
},
"2": {
"name": "punctuation.accessor.js.jsx"
},
"3": {
"name": "punctuation.accessor.optional.js.jsx"
},
"4": {
"name": "support.variable.property.process.js.jsx"
},
"5": {
"name": "support.function.process.js.jsx"
}
}
},
{
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(exports)|(module)(?:(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(exports|id|filename|loaded|parent|children))?)\\b(?!\\$)",
"captures": {
@@ -3660,10 +3636,6 @@
"name": "support.type.object.module.js.jsx"
}
}
},
{
"name": "support.variable.object.node.js.jsx",
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(global|GLOBAL|root|__dirname|__filename)\\b(?!\\$)"
}
]
},