@@ -47,7 +47,7 @@ import { ITextFileService } from '../../../services/textfile/common/textfiles.js
47
47
import { ITerminalGroupService , ITerminalService } from '../../terminal/browser/terminal.js' ;
48
48
import { ITerminalProfileResolverService } from '../../terminal/common/terminal.js' ;
49
49
50
- import { ConfiguringTask , ContributedTask , CustomTask , ExecutionEngine , InMemoryTask , ITaskEvent , ITaskIdentifier , ITaskSet , JsonSchemaVersion , KeyedTaskIdentifier , RuntimeType , Task , TASK_RUNNING_STATE , TaskDefinition , TaskGroup , TaskRunSource , TaskSettingId , TaskSorter , TaskSourceKind , TasksSchemaProperties , USER_TASKS_GROUP_KEY , TaskEventKind , InstancePolicy } from '../common/tasks.js' ;
50
+ import { ConfiguringTask , ContributedTask , CustomTask , ExecutionEngine , InMemoryTask , ITaskEvent , ITaskIdentifier , ITaskSet , JsonSchemaVersion , KeyedTaskIdentifier , RuntimeType , Task , TASK_RUNNING_STATE , TaskDefinition , TaskGroup , TaskRunSource , TaskSettingId , TaskSorter , TaskSourceKind , TasksSchemaProperties , USER_TASKS_GROUP_KEY , TaskEventKind , InstancePolicy , RerunAllRunningTasksCommandId } from '../common/tasks.js' ;
51
51
import { CustomExecutionSupportedContext , ICustomizationProperties , IProblemMatcherRunOptions , ITaskFilter , ITaskProvider , ITaskService , IWorkspaceFolderTaskResult , ProcessExecutionSupportedContext , ServerlessWebContext , ShellExecutionSupportedContext , TaskCommandsRegistered , TaskExecutionSupportedContext } from '../common/taskService.js' ;
52
52
import { ITaskExecuteResult , ITaskResolver , ITaskSummary , ITaskSystem , ITaskSystemInfo , ITaskTerminateResponse , TaskError , TaskErrors , TaskExecuteKind , Triggers , VerifiedTask } from '../common/taskSystem.js' ;
53
53
import { getTemplates as getTaskTemplates } from '../common/taskTemplates.js' ;
@@ -533,6 +533,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
533
533
}
534
534
} ) ;
535
535
536
+ CommandsRegistry . registerCommand ( RerunAllRunningTasksCommandId , async ( accessor , arg ) => {
537
+ if ( await this . _trust ( ) ) {
538
+ this . _runRerunAllRunningTasksCommand ( ) ;
539
+ }
540
+ } ) ;
541
+
536
542
CommandsRegistry . registerCommand ( 'workbench.action.tasks.terminate' , async ( accessor , arg ) => {
537
543
if ( await this . _trust ( ) ) {
538
544
this . _runTerminateCommand ( arg ) ;
@@ -3364,6 +3370,19 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
3364
3370
}
3365
3371
}
3366
3372
3373
+ private async _runRerunAllRunningTasksCommand ( ) : Promise < void > {
3374
+ const activeTasks = await this . getActiveTasks ( ) ;
3375
+
3376
+ if ( activeTasks . length === 0 ) {
3377
+ this . _notificationService . info ( nls . localize ( 'TaskService.noRunningTasks' , 'No running tasks to restart' ) ) ;
3378
+ return ;
3379
+ }
3380
+
3381
+ // Restart all active tasks
3382
+ const restartPromises = activeTasks . map ( task => this . _restart ( task ) ) ;
3383
+ await Promise . allSettled ( restartPromises ) ;
3384
+ }
3385
+
3367
3386
private _getTaskIdentifier ( filter ?: string | ITaskIdentifier ) : string | KeyedTaskIdentifier | undefined {
3368
3387
let result : string | KeyedTaskIdentifier | undefined = undefined ;
3369
3388
if ( Types . isString ( filter ) ) {
0 commit comments