@@ -363,15 +363,15 @@ func GetEachFileNameOfModule(
363363 }
364364 }
365365
366- symlinkedDirectories := host .GetSymlinkCache (). DirectoriesByRealpath ()
366+ symlinkCache := host .GetSymlinkCache ()
367367 fullImportedFileName := tspath .GetNormalizedAbsolutePath (importedFileName , cwd )
368- if symlinkedDirectories != nil {
368+ if symlinkCache != nil {
369369 tspath .ForEachAncestorDirectoryStoppingAtGlobalCache (
370370 host .GetGlobalTypingsCacheLocation (),
371371 tspath .GetDirectoryPath (fullImportedFileName ),
372372 func (realPathDirectory string ) (bool , bool ) {
373- symlinkDirectories := symlinkedDirectories . Get (tspath .ToPath (realPathDirectory , cwd , host .UseCaseSensitiveFileNames ()).EnsureTrailingDirectorySeparator ())
374- if symlinkDirectories == nil {
373+ symlinkSet , ok := symlinkCache . DirectoriesByRealpath (). Load (tspath .ToPath (realPathDirectory , cwd , host .UseCaseSensitiveFileNames ()).EnsureTrailingDirectorySeparator ())
374+ if ! ok {
375375 return false , false
376376 } // Continue to ancestor directory
377377
@@ -392,15 +392,16 @@ func GetEachFileNameOfModule(
392392 UseCaseSensitiveFileNames : host .UseCaseSensitiveFileNames (),
393393 CurrentDirectory : cwd ,
394394 })
395- for _ , symlinkDirectory := range symlinkDirectories {
395+ symlinkSet . Range ( func ( symlinkDirectory string ) bool {
396396 option := tspath .ResolvePath (symlinkDirectory , relative )
397397 results = append (results , ModulePath {
398398 FileName : option ,
399399 IsInNodeModules : ContainsNodeModules (option ),
400400 IsRedirect : target == referenceRedirect ,
401401 })
402402 shouldFilterIgnoredPaths = true // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
403- }
403+ return true
404+ })
404405 }
405406
406407 return false , false
0 commit comments