Skip to content

Commit 9214102

Browse files
authored
Merge pull request #1260 from vuejs/liquid
Fix #1259
2 parents 349bdd3 + f4ba985 commit 9214102

File tree

6 files changed

+111
-1
lines changed

6 files changed

+111
-1
lines changed

client/grammar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const SCOPES: { [lang: string]: string } = {
2121
yaml: 'source.yaml',
2222
json: 'source.json',
2323
php: 'source.php',
24-
graphql: 'source.graphql'
24+
graphql: 'source.graphql',
25+
liquid: 'text.html.liquid'
2526
};
2627

2728
export function getGeneratedGrammar(grammarPath: string, customBlocks: { [k: string]: string }): string {

docs/highlighting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Vetur supports syntax highlighting for the following languages:
99
|`<template lang="jade">`|`pug`|
1010
|`<template lang="haml">`|`haml`|[Better Haml](https://marketplace.visualstudio.com/items?itemName=karunamurti.haml) or [Ruby Haml](https://marketplace.visualstudio.com/items?itemName=vayan.haml)|
1111
|`<template lang="slm">`|`slm`|[Slm Syntax](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-slm)|
12+
|`<template lang="liquid">`|`liquid`|[Liquid Language Support](https://github.com/GingerBear/vscode-liquid)|
1213
|`<style>`|`css`|
1314
|`<style lang="postcss">`|`postcss`|
1415
|`<style lang="scss">`|`scss`|

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"lint": "tslint -c tslint.json client/**/*.ts server/**/*.ts scripts/**/*.ts",
1414
"test:server": "npm run compile && cd server && npm test",
1515
"test:e2e": "node ./dist/test/codeTestRunner.js",
16+
"test:grammar": "node ./dist/test/codeTestRunner.js grammar",
1617
"test:lsp": "node ./dist/test/codeTestRunner.js lsp",
1718
"test:int": "node ./dist/test/codeTestRunner.js interpolation",
1819
"test": "run-s lint compile test:server test:e2e",
@@ -115,6 +116,7 @@
115116
"text.jade.slm": "slm",
116117
"text.pug": "jade",
117118
"text.haml": "haml",
119+
"text.html.liquid": "liquid",
118120
"source.css": "css",
119121
"source.css.scss": "scss",
120122
"source.css.less": "less",

syntaxes/vue-generated.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,49 @@
290290
}
291291
]
292292
},
293+
{
294+
"begin": "(<)(template)\\b(?=[^>]*lang=('liquid'|\"liquid\"))(?![^/>]*/>\\s*$)",
295+
"beginCaptures": {
296+
"1": {
297+
"name": "punctuation.definition.tag.begin.html"
298+
},
299+
"2": {
300+
"name": "entity.name.tag.template.html"
301+
}
302+
},
303+
"end": "(</)(template)(>)",
304+
"endCaptures": {
305+
"1": {
306+
"name": "punctuation.definition.tag.begin.html"
307+
},
308+
"2": {
309+
"name": "entity.name.tag.template.html"
310+
},
311+
"3": {
312+
"name": "punctuation.definition.tag.end.html"
313+
}
314+
},
315+
"patterns": [
316+
{
317+
"include": "#tag-stuff"
318+
},
319+
{
320+
"contentName": "text.html.liquid",
321+
"begin": "(>)",
322+
"beginCaptures": {
323+
"1": {
324+
"name": "punctuation.definition.tag.end.html"
325+
}
326+
},
327+
"end": "(?=</template>)",
328+
"patterns": [
329+
{
330+
"include": "text.html.liquid"
331+
}
332+
]
333+
}
334+
]
335+
},
293336
{
294337
"begin": "(<)(template)(?![^/>]*/>\\s*$)",
295338
"beginCaptures": {

syntaxes/vue.tmLanguage.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,49 @@
204204
}
205205
]
206206
},
207+
{
208+
"begin": "(<)(template)\\b(?=[^>]*lang=('liquid'|\"liquid\"))(?![^/>]*/>\\s*$)",
209+
"beginCaptures": {
210+
"1": {
211+
"name": "punctuation.definition.tag.begin.html"
212+
},
213+
"2": {
214+
"name": "entity.name.tag.template.html"
215+
}
216+
},
217+
"end": "(</)(template)(>)",
218+
"endCaptures": {
219+
"1": {
220+
"name": "punctuation.definition.tag.begin.html"
221+
},
222+
"2": {
223+
"name": "entity.name.tag.template.html"
224+
},
225+
"3": {
226+
"name": "punctuation.definition.tag.end.html"
227+
}
228+
},
229+
"patterns": [
230+
{
231+
"include": "#tag-stuff"
232+
},
233+
{
234+
"contentName": "text.html.liquid",
235+
"begin": "(>)",
236+
"beginCaptures": {
237+
"1": {
238+
"name": "punctuation.definition.tag.end.html"
239+
}
240+
},
241+
"end": "(?=</template>)",
242+
"patterns": [
243+
{
244+
"include": "text.html.liquid"
245+
}
246+
]
247+
}
248+
]
249+
},
207250
{
208251
"begin": "(<)(template)(?![^/>]*/>\\s*$)",
209252
"beginCaptures": {

syntaxes/vue.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,26 @@ patterns:
101101
patterns:
102102
- include: text.jade.slm
103103

104+
# liquid
105+
- begin: (<)(template)\b(?=[^>]*lang=('liquid'|"liquid"))(?![^/>]*/>\s*$)
106+
beginCaptures:
107+
'1': { name: punctuation.definition.tag.begin.html }
108+
'2': { name: entity.name.tag.template.html }
109+
end: (</)(template)(>)
110+
endCaptures:
111+
'1': { name: punctuation.definition.tag.begin.html }
112+
'2': { name: entity.name.tag.template.html }
113+
'3': { name: punctuation.definition.tag.end.html }
114+
patterns:
115+
- include: '#tag-stuff'
116+
- contentName: text.html.liquid
117+
begin: (>)
118+
beginCaptures:
119+
'1': { name: punctuation.definition.tag.end.html }
120+
end: (?=</template>)
121+
patterns:
122+
- include: text.html.liquid
123+
104124
# html
105125
- begin: (<)(template)(?![^/>]*/>\s*$)
106126
beginCaptures:

0 commit comments

Comments
 (0)