thrownewTaskError(Severity.Warning,nls.localize('TaskSystem.active','There is an active running task right now. Terminate it first before executing another task.'),TaskErrors.RunningTask);
// We need to give the child process a change to stop.
setTimeout(()=>{
this.executeTarget(fn);
},2000);
});
returnthis.textFileService.saveAll().then((value)=>{// make sure all dirty files are saved
returnthis.configurationService.loadConfiguration().then(()=>{// make sure configuration is up to date
returnthis.taskSystemPromise.
then((taskSystem)=>{
returntaskSystem.isActive().then((active)=>{
if(!active){
returnfn(taskSystem);
}else{
thrownewTaskError(Severity.Warning,nls.localize('TaskSystem.active','There is an active running task right now. Terminate it first before executing another task.'),TaskErrors.RunningTask);