Skip to content

Commit

Permalink
Unshift custom blocks to beginning of grammar. Fix #1088
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Feb 21, 2019
1 parent c57186f commit 24f04a0
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion client/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function getGeneratedGrammar(grammarPath: string, customBlocks: { [k: str
throw `The language for custom block <${tag}> is invalid`;
}

grammar.patterns.push(makePattern(tag, SCOPES[lang]));
grammar.patterns.unshift(makePattern(tag, SCOPES[lang]));
}
return JSON.stringify(grammar, null, 2);
}
Expand Down
172 changes: 86 additions & 86 deletions syntaxes/vue-generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,92 @@
],
"uuid": "5512c10d-4cc5-434c-b8fc-53b912f55ab3",
"patterns": [
{
"begin": "(<)(i18n)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
}
},
"end": "(</)(i18n)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</i18n>)",
"contentName": "source.json",
"patterns": [
{
"include": "source.json"
}
]
}
]
},
{
"begin": "(<)(docs)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
}
},
"end": "(</)(docs)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</docs>)",
"contentName": "text.html.markdown",
"patterns": [
{
"include": "text.html.markdown"
}
]
}
]
},
{
"name": "comment.block.html",
"begin": "<!--",
Expand Down Expand Up @@ -751,92 +837,6 @@
]
}
]
},
{
"begin": "(<)(docs)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
}
},
"end": "(</)(docs)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</docs>)",
"contentName": "text.html.markdown",
"patterns": [
{
"include": "text.html.markdown"
}
]
}
]
},
{
"begin": "(<)(i18n)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
}
},
"end": "(</)(i18n)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</i18n>)",
"contentName": "source.json",
"patterns": [
{
"include": "source.json"
}
]
}
]
}
],
"repository": {
Expand Down

0 comments on commit 24f04a0

Please sign in to comment.