mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Remove text mate highlighting of more JS/TS built-ins
Identifying specific symbols is a better fit for semantic highlighting instead of textmate as semantic highlighting prevents false positives This keeps around a few of the most built-ins for now but we may revisit these in the future
This commit is contained in:
@@ -8,9 +8,21 @@ import { update } from 'vscode-grammar-updater';
|
||||
|
||||
function removeDom(grammar) {
|
||||
grammar.repository['support-objects'].patterns = grammar.repository['support-objects'].patterns.filter(pattern => {
|
||||
if (pattern.match && /\b(HTMLElement|ATTRIBUTE_NODE|stopImmediatePropagation)\b/g.test(pattern.match)) {
|
||||
if (pattern.match && (
|
||||
/\b(HTMLElement|ATTRIBUTE_NODE|stopImmediatePropagation)\b/g.test(pattern.match)
|
||||
|| /\bJSON\b/g.test(pattern.match)
|
||||
|| /\bMath\b/g.test(pattern.match)
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pattern.name?.startsWith('support.class.error.')
|
||||
|| pattern.name?.startsWith('support.class.builtin.')
|
||||
|| pattern.name?.startsWith('support.function.')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
return grammar;
|
||||
|
||||
Reference in New Issue
Block a user