From e63ceb0bee53c08bb37788aa9f632702929c551e Mon Sep 17 00:00:00 2001 From: "Lyu, Wei Da" Date: Thu, 26 Sep 2024 09:51:29 +0800 Subject: [PATCH] don't need to check during initial load --- .../language-server/src/plugins/typescript/service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/language-server/src/plugins/typescript/service.ts b/packages/language-server/src/plugins/typescript/service.ts index 573c35047..cba9adeaa 100644 --- a/packages/language-server/src/plugins/typescript/service.ts +++ b/packages/language-server/src/plugins/typescript/service.ts @@ -651,11 +651,20 @@ async function createLanguageService( function ensureProjectFileUpdates(newFile?: string): void { const info = parsedTsConfigInfo.get(tsconfigPath); if (!info) { + console.log('No tsconfig info found for', tsconfigPath); return; } - if (newFile && !docContext.globalSnapshotsManager.get(newFile)) { + + if ( + newFile && + !info.pendingProjectFileUpdate && + // no global snapshots yet when initial load pending + !snapshotManager.isProjectFile(newFile) && + !docContext.globalSnapshotsManager.get(newFile) + ) { scheduleProjectFileUpdate([newFile]); } + if (!info.pendingProjectFileUpdate) { return; }