mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
Merge pull request #82377 from microsoft/fix/php-custom-tags
php - fix custom tags appearing invalid
This commit is contained in:
commit
3e1276cb51
|
@ -21,6 +21,14 @@ function adaptInjectionScope(grammar) {
|
|||
injections[newInjectionKey] = injection;
|
||||
}
|
||||
|
||||
function includeDerivativeHtml(grammar) {
|
||||
grammar.patterns.forEach(pattern => {
|
||||
if (pattern.include === 'text.html.basic') {
|
||||
pattern.include = 'text.html.derivative';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Workaround for https://github.com/Microsoft/vscode/issues/40279
|
||||
// and https://github.com/Microsoft/vscode-textmate/issues/59
|
||||
function fixBadRegex(grammar) {
|
||||
|
@ -61,4 +69,7 @@ function fixBadRegex(grammar) {
|
|||
}
|
||||
|
||||
updateGrammar.update('atom/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', fixBadRegex);
|
||||
updateGrammar.update('atom/language-php', 'grammars/html.cson', './syntaxes/html.tmLanguage.json', adaptInjectionScope);
|
||||
updateGrammar.update('atom/language-php', 'grammars/html.cson', './syntaxes/html.tmLanguage.json', grammar => {
|
||||
adaptInjectionScope(grammar);
|
||||
includeDerivativeHtml(grammar);
|
||||
});
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
"name": "comment.line.shebang.php"
|
||||
},
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
"include": "text.html.derivative"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
|
|
1
extensions/php/test/colorize-fixtures/issue-76997.php
Normal file
1
extensions/php/test/colorize-fixtures/issue-76997.php
Normal file
|
@ -0,0 +1 @@
|
|||
<hello></hello>
|
68
extensions/php/test/colorize-results/issue-76997_php.json
Normal file
68
extensions/php/test/colorize-results/issue-76997_php.json
Normal file
|
@ -0,0 +1,68 @@
|
|||
[
|
||||
{
|
||||
"c": "<",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative punctuation.definition.tag.begin.html",
|
||||
"r": {
|
||||
"dark_plus": "punctuation.definition.tag: #808080",
|
||||
"light_plus": "punctuation.definition.tag: #800000",
|
||||
"dark_vs": "punctuation.definition.tag: #808080",
|
||||
"light_vs": "punctuation.definition.tag: #800000",
|
||||
"hc_black": "punctuation.definition.tag: #808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "hello",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative entity.name.tag.html",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.tag: #569CD6",
|
||||
"light_plus": "entity.name.tag: #800000",
|
||||
"dark_vs": "entity.name.tag: #569CD6",
|
||||
"light_vs": "entity.name.tag: #800000",
|
||||
"hc_black": "entity.name.tag: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ">",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative punctuation.definition.tag.end.html",
|
||||
"r": {
|
||||
"dark_plus": "punctuation.definition.tag: #808080",
|
||||
"light_plus": "punctuation.definition.tag: #800000",
|
||||
"dark_vs": "punctuation.definition.tag: #808080",
|
||||
"light_vs": "punctuation.definition.tag: #800000",
|
||||
"hc_black": "punctuation.definition.tag: #808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "</",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative punctuation.definition.tag.begin.html",
|
||||
"r": {
|
||||
"dark_plus": "punctuation.definition.tag: #808080",
|
||||
"light_plus": "punctuation.definition.tag: #800000",
|
||||
"dark_vs": "punctuation.definition.tag: #808080",
|
||||
"light_vs": "punctuation.definition.tag: #800000",
|
||||
"hc_black": "punctuation.definition.tag: #808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "hello",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative entity.name.tag.html",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.tag: #569CD6",
|
||||
"light_plus": "entity.name.tag: #800000",
|
||||
"dark_vs": "entity.name.tag: #569CD6",
|
||||
"light_vs": "entity.name.tag: #800000",
|
||||
"hc_black": "entity.name.tag: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ">",
|
||||
"t": "text.html.php meta.tag.other.unrecognized.html.derivative punctuation.definition.tag.end.html",
|
||||
"r": {
|
||||
"dark_plus": "punctuation.definition.tag: #808080",
|
||||
"light_plus": "punctuation.definition.tag: #800000",
|
||||
"dark_vs": "punctuation.definition.tag: #808080",
|
||||
"light_vs": "punctuation.definition.tag: #800000",
|
||||
"hc_black": "punctuation.definition.tag: #808080"
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Reference in a new issue