Skip to content

Commit

Permalink
fix: only cache no error sfc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Sep 5, 2022
1 parent 89f88c4 commit 15f814d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/vue-language-core/src/sourceFile.ts
Expand Up @@ -151,11 +151,13 @@ export function createSourceFile(
for (const plugin of plugins) {
const sfc = plugin.parseSFC?.(fileName, fileContent.value);
if (sfc) {
parsedSfcCache = {
snapshot: snapshot.value,
sfc,
plugin,
};
if (!sfc.errors.length) {
parsedSfcCache = {
snapshot: snapshot.value,
sfc,
plugin,
};
}
return sfc;
}
}
Expand Down

0 comments on commit 15f814d

Please sign in to comment.