Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions extensions/vscode/syntaxes/vue.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@
]
},
{
"begin": "(template)\\b",
"begin": "(template)(?=\\s|\\/?>)",
"beginCaptures": {
"1": {
"name": "entity.name.tag.$1.html.vue"
Expand All @@ -711,7 +711,7 @@
},
{
"begin": "(?<=>)",
"end": "(?=<\\/template\\b)",
"end": "(?=<\\/template[\\s>])",
"name": "text.html.derivative",
"patterns": [
{
Expand All @@ -722,7 +722,7 @@
]
},
{
"begin": "(script)\\b",
"begin": "(script)(?=\\s|\\/?>)",
"beginCaptures": {
"1": {
"name": "entity.name.tag.$1.html.vue"
Expand All @@ -743,7 +743,7 @@
},
{
"begin": "(?<=>)",
"end": "(?=<\\/script\\b)",
"end": "(?=<\\/script[\\s>])",
"name": "source.js",
"patterns": [
{
Expand All @@ -754,7 +754,7 @@
]
},
{
"begin": "(style)\\b",
"begin": "(style)(?=\\s|\\/?>)",
"beginCaptures": {
"1": {
"name": "entity.name.tag.$1.html.vue"
Expand All @@ -775,7 +775,7 @@
},
{
"begin": "(?<=>)",
"end": "(?=<\\/style\\b)",
"end": "(?=<\\/style[\\s>])",
"name": "source.css",
"patterns": [
{
Expand Down Expand Up @@ -872,7 +872,7 @@
"patterns": [
{
"begin": "\\G",
"end": "(?=/>)|((</)(template)\\b)",
"end": "(?=/>)|((</)(template)(?=[\\s>]))",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.begin.html.vue"
Expand All @@ -891,7 +891,7 @@
]
},
"template-tag-2": {
"begin": "(<)(template)\\b",
"begin": "(<)(template)(?=\\s|\\/?>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html.vue"
Expand All @@ -910,7 +910,7 @@
"patterns": [
{
"begin": "\\G",
"end": "(?=/>)|((</)(template)\\b)",
"end": "(?=/>)|((</)(template)(?=[\\s>]))",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.begin.html.vue"
Expand Down
27 changes: 27 additions & 0 deletions extensions/vscode/tests/__snapshots__/grammar.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,33 @@ exports[`grammar > script-tag-in-script.vue 1`] = `
#^ source.vue"
`;

exports[`grammar > tag-starts-with-template.vue 1`] = `
"><template>
#^ source.vue punctuation.definition.tag.begin.html.vue
# ^^^^^^^^ source.vue entity.name.tag.template.html.vue
# ^ source.vue meta.tag-stuff punctuation.definition.tag.end.html.vue
> <template-foo></template-foo>
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template:foo></template:foo>
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template-foo bar></template-foo>
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template-foo>{{ 0 }}</template-foo>
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template.foo[0].bar></template.foo[0].bar>
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template-foo />
#^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
> <template-foo/>
#^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
></template>
#^^ source.vue punctuation.definition.tag.begin.html.vue
# ^^^^^^^^ source.vue entity.name.tag.template.html.vue
# ^ source.vue punctuation.definition.tag.end.html.vue
>
#^ source.vue"
`;

exports[`grammar > template-expression.vue 1`] = `
"><template>
#^ source.vue punctuation.definition.tag.begin.html.vue
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<template-foo></template-foo>
<template:foo></template:foo>
<template-foo bar></template-foo>
<template-foo>{{ 0 }}</template-foo>
<template.foo[0].bar></template.foo[0].bar>
<template-foo />
<template-foo/>
</template>
Loading