@@ -238,7 +238,7 @@ namespace ts {
238
238
239
239
readonly compilerHost : CompilerHost ;
240
240
readonly moduleResolutionCache : ModuleResolutionCache | undefined ;
241
- readonly packageJsonInfoCache : PackageJsonInfoCache | undefined ;
241
+ readonly typeReferenceDirectiveResolutionCache : TypeReferenceDirectiveResolutionCache | undefined ;
242
242
243
243
// Mutable state
244
244
buildOrder : AnyBuildOrder | undefined ;
@@ -276,14 +276,14 @@ namespace ts {
276
276
compilerHost . resolveModuleNames = maybeBind ( host , host . resolveModuleNames ) ;
277
277
compilerHost . resolveTypeReferenceDirectives = maybeBind ( host , host . resolveTypeReferenceDirectives ) ;
278
278
const moduleResolutionCache = ! compilerHost . resolveModuleNames ? createModuleResolutionCache ( currentDirectory , getCanonicalFileName ) : undefined ;
279
- const packageJsonInfoCache = ! compilerHost . resolveTypeReferenceDirectives ? moduleResolutionCache || createPackageJsonInfoCache ( currentDirectory , getCanonicalFileName ) : undefined ;
279
+ const typeReferenceDirectiveResolutionCache = ! compilerHost . resolveTypeReferenceDirectives ? createTypeReferenceDirectiveResolutionCache ( currentDirectory , getCanonicalFileName , /*options*/ undefined , moduleResolutionCache ?. getPackageJsonInfoCache ( ) ) : undefined ;
280
280
if ( ! compilerHost . resolveModuleNames ) {
281
281
const loader = ( moduleName : string , containingFile : string , redirectedReference : ResolvedProjectReference | undefined ) => resolveModuleName ( moduleName , containingFile , state . projectCompilerOptions , compilerHost , moduleResolutionCache , redirectedReference ) . resolvedModule ! ;
282
282
compilerHost . resolveModuleNames = ( moduleNames , containingFile , _reusedNames , redirectedReference ) =>
283
283
loadWithLocalCache < ResolvedModuleFull > ( Debug . checkEachDefined ( moduleNames ) , containingFile , redirectedReference , loader ) ;
284
284
}
285
285
if ( ! compilerHost . resolveTypeReferenceDirectives ) {
286
- const loader = ( moduleName : string , containingFile : string , redirectedReference : ResolvedProjectReference | undefined ) => resolveTypeReferenceDirective ( moduleName , containingFile , state . projectCompilerOptions , compilerHost , redirectedReference , state . packageJsonInfoCache ) . resolvedTypeReferenceDirective ! ;
286
+ const loader = ( moduleName : string , containingFile : string , redirectedReference : ResolvedProjectReference | undefined ) => resolveTypeReferenceDirective ( moduleName , containingFile , state . projectCompilerOptions , compilerHost , redirectedReference , state . typeReferenceDirectiveResolutionCache ) . resolvedTypeReferenceDirective ! ;
287
287
compilerHost . resolveTypeReferenceDirectives = ( typeReferenceDirectiveNames , containingFile , redirectedReference ) =>
288
288
loadWithLocalCache < ResolvedTypeReferenceDirective > ( Debug . checkEachDefined ( typeReferenceDirectiveNames ) , containingFile , redirectedReference , loader ) ;
289
289
}
@@ -317,7 +317,7 @@ namespace ts {
317
317
318
318
compilerHost,
319
319
moduleResolutionCache,
320
- packageJsonInfoCache ,
320
+ typeReferenceDirectiveResolutionCache ,
321
321
322
322
// Mutable state
323
323
buildOrder : undefined ,
@@ -556,7 +556,7 @@ namespace ts {
556
556
function disableCache ( state : SolutionBuilderState ) {
557
557
if ( ! state . cache ) return ;
558
558
559
- const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, packageJsonInfoCache } = state ;
559
+ const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, typeReferenceDirectiveResolutionCache } = state ;
560
560
561
561
host . readFile = cache . originalReadFile ;
562
562
host . fileExists = cache . originalFileExists ;
@@ -567,7 +567,7 @@ namespace ts {
567
567
state . readFileWithCache = cache . originalReadFileWithCache ;
568
568
extendedConfigCache . clear ( ) ;
569
569
moduleResolutionCache ?. clear ( ) ;
570
- packageJsonInfoCache ?. clear ( ) ;
570
+ typeReferenceDirectiveResolutionCache ?. clear ( ) ;
571
571
state . cache = undefined ;
572
572
}
573
573
0 commit comments