Eagerly resolve module specifiers for auto-import completions in --moduleResolution node12+ (#48752)

* Add failing test

* Block auto-import module specifiers including node_modules path

* Eagerly resolve module specifiers in completions in nodenext so failures can be filtered

* Add completion info flags for telemetry

* Update API baseline

* Update completions baselines

* Fix missed boolean flip

* Fix remaining tests
This commit is contained in:
Andrew Branch authored and GitHub committed 2022-04-27 16:07:15 -07:00
1 parent 717a1be3c9
commit 476fc625df
26 files changed
+239 -73

No files matched your search

+2 -2
View File
@@ -8470,7 +8470,7 @@ namespace ts {
export interface ResolvedModuleSpecifierInfo {
modulePaths: readonly ModulePath[] | undefined;
moduleSpecifiers: readonly string[] | undefined;
isAutoImportable: boolean | undefined;
isBlockedByPackageJsonDependencies: boolean | undefined;
}
/* @internal */
@@ -8482,7 +8482,7 @@ namespace ts {
export interface ModuleSpecifierCache {
get(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions): Readonly<ResolvedModuleSpecifierInfo> | undefined;
set(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[], moduleSpecifiers: readonly string[]): void;
setIsAutoImportable(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isAutoImportable: boolean): void;
setBlockedByPackageJsonDependencies(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isBlockedByPackageJsonDependencies: boolean): void;
setModulePaths(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[]): void;
clear(): void;
count(): number;