@@ -109,21 +109,27 @@ interface ResolutionInfo {
109109 mode : ts . ResolutionMode ;
110110}
111111
112- function getResolutionCacheDetails < T extends ts . ResolutionWithFailedLookupLocations > (
112+ function getResolutionCacheDetails < File , T extends ts . ResolutionWithFailedLookupLocations > (
113113 baseline : string [ ] ,
114114 cacheType : string ,
115- cache : ts . ModeAwareCache < T > | undefined ,
115+ file : File ,
116+ forEach :
117+ | ( (
118+ callback : ( resolvedModule : T , moduleName : string , mode : ts . ResolutionMode ) => void ,
119+ file : File ,
120+ ) => void )
121+ | undefined ,
116122 getResolvedFileName : ( resolution : T ) => string | undefined ,
117123 indent : string ,
118124) {
119125 let addedCacheType = false ;
120- cache ?. forEach ( ( resolved , key , mode ) => {
126+ forEach ?. ( ( resolved , key , mode ) => {
121127 if ( ! addedCacheType ) {
122128 addedCacheType = true ;
123129 baseline . push ( `${ indent } ${ cacheType } :` ) ;
124130 }
125131 baseline . push ( `${ indent } ${ key } : ${ mode ? ts . getNameOfCompilerOptionValue ( mode , ts . moduleOptionDeclaration . type ) + ":" : "" } ${ getResolvedFileName ( resolved ) } ` ) ;
126- } ) ;
132+ } , file ) ;
127133}
128134
129135function getResolvedModuleFileName ( r : ts . ResolvedModuleWithFailedLookupLocations ) {
@@ -157,22 +163,25 @@ function getProgramStructure(program: ts.Program | undefined) {
157163 getResolutionCacheDetails (
158164 baseline ,
159165 "Modules" ,
160- program . resolvedModules ?. get ( f . path ) ,
166+ f ,
167+ program . forEachResolvedModule ,
161168 getResolvedModuleFileName ,
162169 " " ,
163170 ) ;
164171 getResolutionCacheDetails (
165172 baseline ,
166173 "TypeRefs" ,
167- program . resolvedTypeReferenceDirectiveNames ?. get ( f . path ) ,
174+ f ,
175+ program . forEachResolvedTypeReferenceDirective ,
168176 getResolvedTypeRefFileName ,
169177 " " ,
170178 ) ;
171179 } ) ;
172180 getResolutionCacheDetails (
173181 baseline ,
174182 "AutoTypeRefs" ,
175- program ?. getAutomaticTypeDirectiveResolutions ( ) ,
183+ /*file*/ undefined ,
184+ program ?. getAutomaticTypeDirectiveResolutions ( ) . forEach ,
176185 getResolvedTypeRefFileName ,
177186 " " ,
178187 ) ;
0 commit comments