Skip to content

Commit ea9bb02

Browse files
authored
fix(language-core): update ast correctly on repeated v-for modifications (#4772)
1 parent 87a804a commit ea9bb02

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/language-core/lib/plugins/vue-template-html.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,16 @@ const plugin: VueLanguagePlugin = ({ modules }) => {
153153
node.parseResult.key,
154154
node.parseResult.index,
155155
]) {
156-
if (child && !tryUpdateNode(child)) {
157-
return false;
156+
if (child) {
157+
if (!tryUpdateNode(child)) {
158+
return false;
159+
}
160+
if (child.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
161+
const content = child.content.trim();
162+
if (content.startsWith('(') || content.endsWith(')')) {
163+
return false;
164+
}
165+
}
158166
}
159167
}
160168
for (const child of node.children) {

0 commit comments

Comments
 (0)