mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into migrateMapsAndSets
# Conflicts: # src/compiler/checker.ts # src/compiler/commandLineParser.ts # src/compiler/core.ts # src/compiler/moduleNameResolver.ts # src/compiler/transformers/declarations.ts # src/compiler/tsbuildPublic.ts # src/compiler/types.ts # src/compiler/utilities.ts # src/harness/client.ts # src/server/editorServices.ts # src/server/typingsCache.ts # src/server/utilities.ts # src/services/codefixes/convertToAsyncFunction.ts # src/services/documentRegistry.ts # src/services/importTracker.ts # src/services/refactorProvider.ts # src/services/refactors/extractSymbol.ts # src/testRunner/unittests/programApi.ts # src/typingsInstallerCore/typingsInstaller.ts # tests/baselines/reference/api/tsserverlibrary.d.ts # tests/baselines/reference/api/typescript.d.ts
This commit is contained in:
@@ -442,8 +442,8 @@ namespace ts {
|
||||
* This assumes that any module id will have the same resolution for sibling files located in the same folder.
|
||||
*/
|
||||
export interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<string, ResolvedModuleWithFailedLookupLocations>;
|
||||
/*@internal*/ directoryToModuleNameMap: CacheWithRedirects<Map<string, ResolvedModuleWithFailedLookupLocations>>;
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
|
||||
/*@internal*/ directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -472,18 +472,18 @@ namespace ts {
|
||||
|
||||
/*@internal*/
|
||||
export interface CacheWithRedirects<T> {
|
||||
ownMap: Map<string, T>;
|
||||
redirectsMap: Map<Path, Map<string, T>>;
|
||||
getOrCreateMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): Map<string, T>;
|
||||
ownMap: ESMap<string, T>;
|
||||
redirectsMap: ESMap<Path, ESMap<string, T>>;
|
||||
getOrCreateMapOfCacheRedirects(redirectedReference: ResolvedProjectReference | undefined): ESMap<string, T>;
|
||||
clear(): void;
|
||||
setOwnOptions(newOptions: CompilerOptions): void;
|
||||
setOwnMap(newOwnMap: Map<string, T>): void;
|
||||
setOwnMap(newOwnMap: ESMap<string, T>): void;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function createCacheWithRedirects<T>(options?: CompilerOptions): CacheWithRedirects<T> {
|
||||
let ownMap: Map<string, T> = new Map();
|
||||
const redirectsMap = new Map<Path, Map<string, T>>();
|
||||
let ownMap: ESMap<string, T> = new Map();
|
||||
const redirectsMap = new Map<Path, ESMap<string, T>>();
|
||||
return {
|
||||
ownMap,
|
||||
redirectsMap,
|
||||
@@ -497,7 +497,7 @@ namespace ts {
|
||||
options = newOptions;
|
||||
}
|
||||
|
||||
function setOwnMap(newOwnMap: Map<string, T>) {
|
||||
function setOwnMap(newOwnMap: ESMap<string, T>) {
|
||||
ownMap = newOwnMap;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ namespace ts {
|
||||
|
||||
/*@internal*/
|
||||
export function createModuleResolutionCacheWithMaps(
|
||||
directoryToModuleNameMap: CacheWithRedirects<Map<string, ResolvedModuleWithFailedLookupLocations>>,
|
||||
directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>,
|
||||
moduleNameToDirectoryMap: CacheWithRedirects<PerModuleNameCache>,
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName): ModuleResolutionCache {
|
||||
@@ -532,7 +532,7 @@ namespace ts {
|
||||
|
||||
function getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference) {
|
||||
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
||||
return getOrCreateCache<Map<string, ResolvedModuleWithFailedLookupLocations>>(directoryToModuleNameMap, redirectedReference, path, () => new Map());
|
||||
return getOrCreateCache<ESMap<string, ResolvedModuleWithFailedLookupLocations>>(directoryToModuleNameMap, redirectedReference, path, () => new Map());
|
||||
}
|
||||
|
||||
function getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache {
|
||||
|
||||
Reference in New Issue
Block a user