@@ -2509,7 +2509,10 @@ namespace ts.server {
2509
2509
* Traverse till project Root and create those configured projects
2510
2510
*/
2511
2511
private createAncestorConfiguredProjects ( info : ScriptInfo , project : ConfiguredProject ) {
2512
- if ( ! project . containsScriptInfo ( info ) || ! project . getCompilerOptions ( ) . composite ) return ;
2512
+ if ( ! project . containsScriptInfo ( info ) || ! project . getCompilerOptions ( ) . composite ) {
2513
+ return ;
2514
+ }
2515
+
2513
2516
const configPath = this . toPath ( project . canonicalConfigFilePath ) ;
2514
2517
const configInfo : OriginalFileInfo = {
2515
2518
fileName : project . getConfigFilePath ( ) ,
@@ -2522,11 +2525,14 @@ namespace ts.server {
2522
2525
const configFileName = this . getConfigFileNameForFile ( configInfo ) ;
2523
2526
if ( ! configFileName ) return ;
2524
2527
2525
- // TODO: may be we should create only first project and then once its loaded,
2526
- // do pending search if this is composite ?
2527
2528
const ancestor = this . findConfiguredProjectByProjectName ( configFileName ) ||
2528
2529
this . createConfiguredProjectWithDelayLoad ( configFileName , `Project possibly referencing default composite project ${ project . getProjectName ( ) } of open file ${ info . fileName } ` ) ;
2529
- ancestor . setPotentialProjectRefence ( configPath ) ;
2530
+ if ( ancestor . isInitialLoadPending ( ) ) {
2531
+ ancestor . setPotentialProjectRefence ( configPath ) ;
2532
+ }
2533
+ else if ( ! project . getCompilerOptions ( ) . composite ) {
2534
+ return ;
2535
+ }
2530
2536
2531
2537
configInfo . fileName = configFileName ;
2532
2538
configInfo . path = this . toPath ( configFileName ) ;
0 commit comments