Skip to content

Commit 060e8fa

Browse files
committed
fix(language-core): dispose virtual code correctly
1 parent 6db9678 commit 060e8fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/language-core/lib/languagePlugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ export function createVueLanguagePlugin<T>(
7979
}
8080
}
8181
},
82-
updateVirtualCode(_fileId, code, snapshot) {
82+
updateVirtualCode(_scriptId, code, snapshot) {
8383
code.update(snapshot);
8484
return code;
8585
},
86+
disposeVirtualCode(scriptId) {
87+
const fileName = asFileName(scriptId);
88+
fileRegistry.delete(fileName);
89+
},
8690
typescript: {
8791
extraFileExtensions: getAllExtensions(vueCompilerOptions)
8892
.map<ts.FileExtensionInfo>(ext => ({

0 commit comments

Comments
 (0)