mirror of https://github.com/microsoft/vscode.git
Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
This commit is contained in:
parent
c0fb773eb9
commit
4064f17252
|
@ -32,6 +32,22 @@ function patchGrammar(grammar) {
|
|||
console.warn(`Expected to patch 2 occurrences of source.js & source.css: Was ${patchCount}`);
|
||||
}
|
||||
|
||||
return grammar;
|
||||
}
|
||||
|
||||
function patchGrammarDerivative(grammar) {
|
||||
let patchCount = 0;
|
||||
|
||||
let patterns = grammar.patterns;
|
||||
for (let key in patterns) {
|
||||
if (patterns[key]?.name === 'meta.tag.other.unrecognized.html.derivative' && patterns[key]?.begin === '(</?)(\\w[^\\s>]*)(?<!/)') {
|
||||
patterns[key].begin = '(</?)(\\w[^\\s<>]*)(?<!/)';
|
||||
patchCount++;
|
||||
}
|
||||
}
|
||||
if (patchCount !== 1) {
|
||||
console.warn(`Expected to do 1 patch: Was ${patchCount}`);
|
||||
}
|
||||
|
||||
return grammar;
|
||||
}
|
||||
|
@ -40,4 +56,6 @@ const tsGrammarRepo = 'textmate/html.tmbundle';
|
|||
const grammarPath = 'Syntaxes/HTML.plist';
|
||||
vscodeGrammarUpdater.update(tsGrammarRepo, grammarPath, './syntaxes/html.tmLanguage.json', grammar => patchGrammar(grammar));
|
||||
|
||||
const grammarDerivativePath = 'Syntaxes/HTML%20%28Derivative%29.tmLanguage';
|
||||
vscodeGrammarUpdater.update(tsGrammarRepo, grammarDerivativePath, './syntaxes/html-derivative.tmLanguage.json', grammar => patchGrammarDerivative(grammar));
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"include": "text.html.basic#core-minus-invalid"
|
||||
},
|
||||
{
|
||||
"begin": "(</?)(\\w[^\\s>]*)(?<!/)",
|
||||
"begin": "(</?)(\\w[^\\s<>]*)(?<!/)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.html"
|
||||
|
|
Loading…
Reference in New Issue