@@ -11,7 +11,6 @@ namespace ts {
11
11
12
12
invalidateResolutionsOfFailedLookupLocations ( ) : boolean ;
13
13
invalidateResolutionOfFile ( filePath : Path ) : void ;
14
- removeRelativeNoResolveResolutionsOfFile ( filePath : Path ) : boolean ;
15
14
removeResolutionsOfFile ( filePath : Path ) : void ;
16
15
removeResolutionsFromProjectReferenceRedirects ( filePath : Path ) : void ;
17
16
setFilesWithInvalidatedNonRelativeUnresolvedImports ( filesWithUnresolvedImports : ESMap < Path , readonly string [ ] > ) : void ;
@@ -142,21 +141,7 @@ namespace ts {
142
141
type GetResolutionWithResolvedFileName < T extends ResolutionWithFailedLookupLocations = ResolutionWithFailedLookupLocations , R extends ResolutionWithResolvedFileName = ResolutionWithResolvedFileName > =
143
142
( resolution : T ) => R | undefined ;
144
143
145
- export enum ResolutionKind {
146
- All ,
147
- RelativeReferencesInOpenFileOnly
148
- }
149
-
150
- const noResolveResolvedModule : ResolvedModuleWithFailedLookupLocations = {
151
- resolvedModule : undefined ,
152
- failedLookupLocations : [ ]
153
- } ;
154
- const noResolveResolvedTypeReferenceDirective : ResolvedTypeReferenceDirectiveWithFailedLookupLocations = {
155
- resolvedTypeReferenceDirective : undefined ,
156
- failedLookupLocations : [ ]
157
- } ;
158
-
159
- export function createResolutionCache ( resolutionHost : ResolutionCacheHost , rootDirForResolution : string | undefined , resolutionKind : ResolutionKind , logChangesWhenResolvingModule : boolean ) : ResolutionCache {
144
+ export function createResolutionCache ( resolutionHost : ResolutionCacheHost , rootDirForResolution : string | undefined , logChangesWhenResolvingModule : boolean ) : ResolutionCache {
160
145
let filesWithChangedSetOfUnresolvedImports : Path [ ] | undefined ;
161
146
let filesWithInvalidatedResolutions : Set < Path > | undefined ;
162
147
let filesWithInvalidatedNonRelativeUnresolvedImports : ReadonlyESMap < Path , readonly string [ ] > | undefined ;
@@ -221,7 +206,6 @@ namespace ts {
221
206
hasChangedAutomaticTypeDirectiveNames : ( ) => hasChangedAutomaticTypeDirectiveNames ,
222
207
invalidateResolutionOfFile,
223
208
invalidateResolutionsOfFailedLookupLocations,
224
- removeRelativeNoResolveResolutionsOfFile,
225
209
setFilesWithInvalidatedNonRelativeUnresolvedImports,
226
210
createHasInvalidatedResolution,
227
211
updateTypeRootsWatch,
@@ -357,12 +341,11 @@ namespace ts {
357
341
shouldRetryResolution : ( t : T ) => boolean ;
358
342
reusedNames ?: readonly string [ ] ;
359
343
logChanges ?: boolean ;
360
- noResolveResolution : T ;
361
344
}
362
345
function resolveNamesWithLocalCache < T extends ResolutionWithFailedLookupLocations , R extends ResolutionWithResolvedFileName > ( {
363
346
names, containingFile, redirectedReference,
364
347
cache, perDirectoryCacheWithRedirects,
365
- loader, getResolutionWithResolvedFileName, noResolveResolution ,
348
+ loader, getResolutionWithResolvedFileName,
366
349
shouldRetryResolution, reusedNames, logChanges
367
350
} : ResolveNamesWithLocalCacheInput < T , R > ) : ( R | undefined ) [ ] {
368
351
const path = resolutionHost . toPath ( containingFile ) ;
@@ -399,10 +382,7 @@ namespace ts {
399
382
resolution = resolutionInDirectory ;
400
383
}
401
384
else {
402
- resolution = resolutionKind === ResolutionKind . All ||
403
- ( isExternalModuleNameRelative ( name ) && resolutionHost . fileIsOpen ( path ) ) ?
404
- loader ( name , containingFile , compilerOptions , resolutionHost . getCompilerHost ?.( ) || resolutionHost , redirectedReference ) :
405
- noResolveResolution ;
385
+ resolution = loader ( name , containingFile , compilerOptions , resolutionHost . getCompilerHost ?.( ) || resolutionHost , redirectedReference ) ;
406
386
perDirectoryResolution . set ( name , resolution ) ;
407
387
}
408
388
resolutionsInFile . set ( name , resolution ) ;
@@ -461,7 +441,6 @@ namespace ts {
461
441
loader : resolveTypeReferenceDirective ,
462
442
getResolutionWithResolvedFileName : getResolvedTypeReferenceDirective ,
463
443
shouldRetryResolution : resolution => resolution . resolvedTypeReferenceDirective === undefined ,
464
- noResolveResolution : noResolveResolvedTypeReferenceDirective ,
465
444
} ) ;
466
445
}
467
446
@@ -477,7 +456,6 @@ namespace ts {
477
456
shouldRetryResolution : resolution => ! resolution . resolvedModule || ! resolutionExtensionIsTSOrJson ( resolution . resolvedModule . extension ) ,
478
457
reusedNames,
479
458
logChanges : logChangesWhenResolvingModule ,
480
- noResolveResolution : noResolveResolvedModule ,
481
459
} ) ;
482
460
}
483
461
@@ -763,31 +741,6 @@ namespace ts {
763
741
}
764
742
}
765
743
766
- function removeRelativeNoResolveResolutionsOfFileFromCache < T extends ResolutionWithFailedLookupLocations > (
767
- cache : ESMap < Path , ESMap < string , T > > ,
768
- filePath : Path ,
769
- noResolveResolution : T ,
770
- ) {
771
- Debug . assert ( resolutionKind === ResolutionKind . RelativeReferencesInOpenFileOnly ) ;
772
- // Deleted file, stop watching failed lookups for all the resolutions in the file
773
- const resolutions = cache . get ( filePath ) ;
774
- if ( ! resolutions ) return false ;
775
- let invalidated = false ;
776
- resolutions . forEach ( ( resolution , name ) => {
777
- if ( resolution === noResolveResolution && isExternalModuleNameRelative ( name ) ) {
778
- resolutions . delete ( name ) ;
779
- invalidated = true ;
780
- }
781
- } ) ;
782
- return invalidated ;
783
- }
784
-
785
- function removeRelativeNoResolveResolutionsOfFile ( filePath : Path ) {
786
- let invalidated = removeRelativeNoResolveResolutionsOfFileFromCache ( resolvedModuleNames , filePath , noResolveResolvedModule ) ;
787
- invalidated = removeRelativeNoResolveResolutionsOfFileFromCache ( resolvedTypeReferenceDirectives , filePath , noResolveResolvedTypeReferenceDirective ) || invalidated ;
788
- return invalidated ;
789
- }
790
-
791
744
function setFilesWithInvalidatedNonRelativeUnresolvedImports ( filesMap : ReadonlyESMap < Path , readonly string [ ] > ) {
792
745
Debug . assert ( filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined ) ;
793
746
filesWithInvalidatedNonRelativeUnresolvedImports = filesMap ;
0 commit comments