Skip to content

Commit e862758

Browse files
authored
fix(vscode): inline html comment pattern in Vue syntax definition (#5327)
1 parent 9d4344d commit e862758

File tree

2 files changed

+55
-45
lines changed

2 files changed

+55
-45
lines changed

extensions/vscode/syntaxes/vue.tmLanguage.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
{
77
"include": "#vue-comments"
88
},
9-
{
10-
"include": "text.html.basic#comment"
11-
},
129
{
1310
"include": "#self-closing-tag"
1411
},
@@ -1286,6 +1283,16 @@
12861283
"patterns": [
12871284
{
12881285
"include": "#vue-comments-key-value"
1286+
},
1287+
{
1288+
"begin": "<!--",
1289+
"captures": {
1290+
"0": {
1291+
"name": "punctuation.definition.comment.vue"
1292+
}
1293+
},
1294+
"end": "-->",
1295+
"name": "comment.block.vue"
12891296
}
12901297
]
12911298
},

extensions/vscode/tests/__snapshots__/grammar.spec.ts.snap

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -134,68 +134,71 @@ exports[`grammar > directives.vue 1`] = `
134134
>
135135
#^ source.vue
136136
><!-- TODO -->
137-
#^ source.vue punctuation.definition.tag.begin.html.vue
138-
# ^ source.vue
139-
# ^^ source.vue entity.name.tag.--.html.vue
140-
# ^^^^^^^^ source.vue meta.tag-stuff
141-
# ^ source.vue meta.tag-stuff punctuation.definition.tag.end.html.vue
137+
#^^^^ source.vue comment.block.vue punctuation.definition.comment.vue
138+
# ^^^^^^ source.vue comment.block.vue
139+
# ^^^ source.vue comment.block.vue punctuation.definition.comment.vue
142140
><template lang="html">
143-
#^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
141+
#^ source.vue punctuation.definition.tag.begin.html.vue
142+
# ^^^^^^^^ source.vue entity.name.tag.template.html.vue
143+
# ^^^^^^^^^^^^ source.vue meta.tag-stuff
144+
# ^ source.vue meta.tag-stuff punctuation.definition.tag.end.html.vue
144145
> <div @click></div>
145-
#^^^^^^^^^^^^^ source.vue text
146-
# ^^^^^^^ source.vue text
146+
#^^^^^^^^^^^^^ source.vue text.html.derivative
147+
# ^^^^^^^ source.vue text.html.derivative
147148
> <div @click="{}"></div>
148-
#^^^^^^^^^^^^^^^^^^ source.vue text
149-
# ^^^^^^^ source.vue text
149+
#^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
150+
# ^^^^^^^ source.vue text.html.derivative
150151
> <div @click="log('hello'); log('world');"></div>
151-
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
152-
# ^^^^^^^ source.vue text
152+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
153+
# ^^^^^^^ source.vue text.html.derivative
153154
> <div #default></div>
154-
#^^^^^^^^^^^^^^^ source.vue text
155-
# ^^^^^^^ source.vue text
155+
#^^^^^^^^^^^^^^^ source.vue text.html.derivative
156+
# ^^^^^^^ source.vue text.html.derivative
156157
> <div #default="args"></div>
157-
#^^^^^^^^^^^^^^^^^^^^^^ source.vue text
158-
# ^^^^^^^ source.vue text
158+
#^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
159+
# ^^^^^^^ source.vue text.html.derivative
159160
> <div #></div>
160-
#^^^^^^^^ source.vue text
161-
# ^^^^^^^ source.vue text
161+
#^^^^^^^^ source.vue text.html.derivative
162+
# ^^^^^^^ source.vue text.html.derivative
162163
> <div #="args"></div>
163-
#^^^^^^^^^^^^^^^ source.vue text
164-
# ^^^^^^^ source.vue text
164+
#^^^^^^^^^^^^^^^ source.vue text.html.derivative
165+
# ^^^^^^^ source.vue text.html.derivative
165166
> <div :key></div>
166-
#^^^^^^^^^^^ source.vue text
167-
# ^^^^^^^ source.vue text
167+
#^^^^^^^^^^^ source.vue text.html.derivative
168+
# ^^^^^^^ source.vue text.html.derivative
168169
> <div :key="{}"></div>
169-
#^^^^^^^^^^^^^^^^ source.vue text
170-
# ^^^^^^^ source.vue text
170+
#^^^^^^^^^^^^^^^^ source.vue text.html.derivative
171+
# ^^^^^^^ source.vue text.html.derivative
171172
> <div v-if="true"></div>
172-
#^^^^^^^^^^^^^^^^^^ source.vue text
173-
# ^^^^^^^ source.vue text
173+
#^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
174+
# ^^^^^^^ source.vue text.html.derivative
174175
> <div v-else-if="true"></div>
175-
#^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
176-
# ^^^^^^^ source.vue text
176+
#^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
177+
# ^^^^^^^ source.vue text.html.derivative
177178
> <div v-else></div>
178-
#^^^^^^^^^^^^^ source.vue text
179-
# ^^^^^^^ source.vue text
179+
#^^^^^^^^^^^^^ source.vue text.html.derivative
180+
# ^^^^^^^ source.vue text.html.derivative
180181
> <div v-for="n in []"></div>
181-
#^^^^^^^^^^^^^^^^^^^^^^ source.vue text
182-
# ^^^^^^^ source.vue text
182+
#^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
183+
# ^^^^^^^ source.vue text.html.derivative
183184
> <div v-if="true" v-else-if="true" v-else></div>
184-
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
185-
# ^^^^^^^ source.vue text
185+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
186+
# ^^^^^^^ source.vue text.html.derivative
186187
> <div :foo="':foo=123'"></div>
187-
#^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
188-
# ^^^^^^^ source.vue text
188+
#^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
189+
# ^^^^^^^ source.vue text.html.derivative
189190
> <div :foo="[{ bar: []}]"></div>
190-
#^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text
191-
# ^^^^^^^ source.vue text
191+
#^^^^^^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
192+
# ^^^^^^^ source.vue text.html.derivative
192193
> <div .prop="[1, 2]"></div>
193-
#^^^^^^^^^^^^^^^^^^^^^ source.vue text
194-
# ^^^^^^^ source.vue text
194+
#^^^^^^^^^^^^^^^^^^^^^ source.vue text.html.derivative
195+
# ^^^^^^^ source.vue text.html.derivative
195196
></template>
196-
#^^^^^^^^^^^ source.vue
197+
#^^ source.vue punctuation.definition.tag.begin.html.vue
198+
# ^^^^^^^^ source.vue entity.name.tag.template.html.vue
199+
# ^ source.vue punctuation.definition.tag.end.html.vue
197200
>
198-
#^ source.vue text"
201+
#^ source.vue"
199202
`;
200203
201204
exports[`grammar > generic.vue 1`] = `

0 commit comments

Comments
 (0)