diff --git a/server/src/analyzer/importResolver.ts b/server/src/analyzer/importResolver.ts index 6cac9bece9de..19e33064eb2c 100644 --- a/server/src/analyzer/importResolver.ts +++ b/server/src/analyzer/importResolver.ts @@ -823,7 +823,13 @@ export class ImportResolver { // Potentially modifies the ImportResult by removing some or all of the // implicit import entries. Only the imported symbols should be included. private _filterImplicitImports(importResult: ImportResult, importedSymbols: string[] | undefined): ImportResult { - if (importedSymbols === undefined || importedSymbols.length === 0) { + if (importedSymbols === undefined) { + const newImportResult = Object.assign({}, importResult); + newImportResult.implicitImports = []; + return newImportResult; + } + + if (importedSymbols.length === 0) { return importResult; } diff --git a/server/src/analyzer/sourceFile.ts b/server/src/analyzer/sourceFile.ts index 5a1d609bef80..bd0d5db527b4 100644 --- a/server/src/analyzer/sourceFile.ts +++ b/server/src/analyzer/sourceFile.ts @@ -796,10 +796,8 @@ export class SourceFile { } } - private _resolveImports(importResolver: ImportResolver, - moduleImports: ModuleImport[], - execEnv: ExecutionEnvironment): - [ImportResult[], ImportResult?, string?, string?] { + private _resolveImports(importResolver: ImportResolver, moduleImports: ModuleImport[], + execEnv: ExecutionEnvironment): [ImportResult[], ImportResult?, string?, string?] { const imports: ImportResult[] = [];