@@ -2490,7 +2490,10 @@ namespace ts.server {
2490
2490
* Traverse till project Root and create those configured projects
2491
2491
*/
2492
2492
private createAncestorConfiguredProjects ( info : ScriptInfo , project : ConfiguredProject ) {
2493
- if ( ! project . containsScriptInfo ( info ) || ! project . getCompilerOptions ( ) . composite ) return ;
2493
+ if ( ! project . containsScriptInfo ( info ) || ! project . getCompilerOptions ( ) . composite ) {
2494
+ return ;
2495
+ }
2496
+
2494
2497
const configPath = this . toPath ( project . canonicalConfigFilePath ) ;
2495
2498
const configInfo : OriginalFileInfo = {
2496
2499
fileName : project . getConfigFilePath ( ) ,
@@ -2503,11 +2506,14 @@ namespace ts.server {
2503
2506
const configFileName = this . getConfigFileNameForFile ( configInfo ) ;
2504
2507
if ( ! configFileName ) return ;
2505
2508
2506
- // TODO: may be we should create only first project and then once its loaded,
2507
- // do pending search if this is composite ?
2508
2509
const ancestor = this . findConfiguredProjectByProjectName ( configFileName ) ||
2509
2510
this . createConfiguredProjectWithDelayLoad ( configFileName , `Project possibly referencing default composite project ${ project . getProjectName ( ) } of open file ${ info . fileName } ` ) ;
2510
- ancestor . setPotentialProjectRefence ( configPath ) ;
2511
+ if ( ancestor . isInitialLoadPending ( ) ) {
2512
+ ancestor . setPotentialProjectRefence ( configPath ) ;
2513
+ }
2514
+ else if ( ! project . getCompilerOptions ( ) . composite ) {
2515
+ return ;
2516
+ }
2511
2517
2512
2518
configInfo . fileName = configFileName ;
2513
2519
configInfo . path = this . toPath ( configFileName ) ;
0 commit comments