@@ -210,6 +210,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
210
210
protected _taskSystemInfos : Map < string , ITaskSystemInfo [ ] > ;
211
211
212
212
protected _workspaceTasksPromise ?: Promise < Map < string , IWorkspaceFolderTaskResult > > ;
213
+ protected readonly _whenTaskSystemReady : Promise < void > ;
213
214
214
215
protected _taskSystem ?: ITaskSystem ;
215
216
protected _taskSystemListeners ?: IDisposable [ ] = [ ] ;
@@ -267,7 +268,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
267
268
@IInstantiationService private readonly _instantiationService : IInstantiationService
268
269
) {
269
270
super ( ) ;
270
-
271
+ this . _whenTaskSystemReady = Event . toPromise ( this . onDidChangeTaskSystemInfo ) ;
271
272
this . _workspaceTasksPromise = undefined ;
272
273
this . _taskSystem = undefined ;
273
274
this . _taskSystemListeners = undefined ;
@@ -373,7 +374,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
373
374
this . _tasksReconnected = true ;
374
375
return ;
375
376
}
376
- this . _getTaskSystem ( ) ;
377
377
this . getWorkspaceTasks ( ) . then ( async ( ) => {
378
378
this . _tasksReconnected = await this . _reconnectTasks ( ) ;
379
379
} ) ;
@@ -2200,9 +2200,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2200
2200
return new Map ( ) ;
2201
2201
}
2202
2202
await this . _waitForSupportedExecutions ;
2203
- // The build task might be run before folder open. On folder open, we need to update the tasks so that
2204
- // all tasks are parsed. #173384
2205
- if ( runSource !== TaskRunSource . FolderOpen && this . _workspaceTasksPromise ) {
2203
+ await this . _whenTaskSystemReady ;
2204
+ if ( this . _workspaceTasksPromise ) {
2206
2205
return this . _workspaceTasksPromise ;
2207
2206
}
2208
2207
return this . _updateWorkspaceTasks ( runSource ) ;
0 commit comments