Exclude strings from HTML grammar patch (#168306)

Fixes #160549
This commit is contained in:
Alex Ross
2022-12-07 14:44:00 +01:00
committed by GitHub
parent f7c5c0dbab
commit 4532436315
2 changed files with 7 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ function patchGrammar(grammar) {
let visit = function (rule, parent) {
if (rule.name === 'source.js' || rule.name === 'source.css') {
if (parent.parent && parent.parent.property === 'endCaptures') {
if (parent.node[0].name !== 'punctuation.definition.string.end.html' && parent.parent && parent.parent.property === 'endCaptures') {
rule.name = rule.name + '-ignored-vscode';
patchCount++;
}
@@ -28,8 +28,8 @@ function patchGrammar(grammar) {
for (let key in repository) {
visit(repository[key], { node: repository, property: key, parent: undefined });
}
if (patchCount !== 6) {
console.warn(`Expected to patch 6 occurrences of source.js & source.css: Was ${patchCount}`);
if (patchCount !== 2) {
console.warn(`Expected to patch 2 occurrences of source.js & source.css: Was ${patchCount}`);
}