From f8a7913c1e67cc7262c49b144a90b9d577a16fef Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 18 Jul 2024 14:16:07 -0700 Subject: [PATCH] Dont filter type aquisition when its not enabled (#59351) --- src/server/project.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/project.ts b/src/server/project.ts index d6fb86425de..cf4167040cc 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1077,7 +1077,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo } protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition { - if (!newTypeAcquisition || !newTypeAcquisition.include) { + if (!newTypeAcquisition.enable || !newTypeAcquisition.include) { // Nothing to filter out, so just return as-is return newTypeAcquisition; } @@ -1627,8 +1627,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo } protected removeExistingTypings(include: string[]): string[] { + if (!include.length) return include; const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); - return include.filter(i => !existing.includes(i)); + return filter(include, i => !existing.includes(i)); } private updateGraphWorker() {