diff --git a/packages/language-core/lib/virtualFile/computedVueSfc.ts b/packages/language-core/lib/virtualFile/computedVueSfc.ts index 56018604cb..6c57a0044f 100644 --- a/packages/language-core/lib/virtualFile/computedVueSfc.ts +++ b/packages/language-core/lib/virtualFile/computedVueSfc.ts @@ -20,6 +20,7 @@ export function computedVueSfc( // incremental update if (cache?.plugin.updateSFC) { const change = snapshot.get().getChangeRange(cache.snapshot); + cache.snapshot = snapshot.get(); if (change) { const newSfc = cache.plugin.updateSFC(cache.sfc, { start: change.span.start, @@ -27,7 +28,6 @@ export function computedVueSfc( newText: snapshot.get().getText(change.span.start, change.span.start + change.newLength), }); if (newSfc) { - cache.snapshot = snapshot.get(); // force dirty cache.sfc = JSON.parse(JSON.stringify(newSfc)); return cache.sfc;