@@ -321,6 +321,7 @@ export class ProjectManager implements Disposable {
321
321
span . addTags ( { uri, maxDepth } ) ;
322
322
ignore . add ( uri ) ;
323
323
return this . ensureModuleStructure ( span )
324
+ . concat ( Observable . defer ( ( ) => this . ensureConfigDependencies ( ) ) )
324
325
// If max depth was reached, don't go any further
325
326
. concat ( Observable . defer ( ( ) => maxDepth === 0 ? Observable . empty < never > ( ) : this . resolveReferencedFiles ( uri ) ) )
326
327
// Prevent cycles
@@ -337,6 +338,24 @@ export class ProjectManager implements Disposable {
337
338
} ) ;
338
339
}
339
340
341
+ isConfigDependency ( uri : string ) : boolean {
342
+ for ( const config of this . configurations ( ) ) {
343
+ config . ensureConfigFile ( ) ;
344
+ if ( config . isExpectedDeclarationFile ( uri ) ) {
345
+ return true ;
346
+ }
347
+ }
348
+ return false ;
349
+ }
350
+
351
+ ensureConfigDependencies ( ) : Observable < never > {
352
+ return observableFromIterable ( this . inMemoryFs . uris ( ) )
353
+ . filter ( uri => this . isConfigDependency ( uri2path ( uri ) ) )
354
+ . mergeMap ( uri => this . updater . ensure ( uri ) )
355
+ . publishReplay ( )
356
+ . refCount ( ) ;
357
+ }
358
+
340
359
/**
341
360
* Invalidates a cache entry for `resolveReferencedFiles` (e.g. because the file changed)
342
361
*
@@ -877,7 +896,7 @@ export class ProjectConfiguration {
877
896
* [isExpectedDeclarationFile description]
878
897
* @param {string } fileName [description]
879
898
*/
880
- private isExpectedDeclarationFile ( fileName : string ) {
899
+ public isExpectedDeclarationFile ( fileName : string ) {
881
900
if ( isDeclarationFile ( fileName ) ) {
882
901
return this . expectedFilePaths . has ( toUnixPath ( fileName ) ) ||
883
902
this . typeRoots . some ( root => fileName . startsWith ( root ) ) ;
0 commit comments