mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
fixes #83705
This commit is contained in:
@@ -675,13 +675,13 @@ export class DebugService implements IDebugService {
|
||||
}
|
||||
|
||||
stopSession(session: IDebugSession): Promise<any> {
|
||||
|
||||
if (session) {
|
||||
return session.terminate();
|
||||
}
|
||||
|
||||
const sessions = this.model.getSessions();
|
||||
if (sessions.length === 0) {
|
||||
this.taskRunner.cancel();
|
||||
this.endInitializingState();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ export const enum TaskRunResult {
|
||||
|
||||
export class DebugTaskRunner {
|
||||
|
||||
private canceled = false;
|
||||
|
||||
constructor(
|
||||
@ITaskService private readonly taskService: ITaskService,
|
||||
@IMarkerService private readonly markerService: IMarkerService,
|
||||
@@ -46,9 +48,17 @@ export class DebugTaskRunner {
|
||||
@IDialogService private readonly dialogService: IDialogService,
|
||||
) { }
|
||||
|
||||
cancel(): void {
|
||||
this.canceled = true;
|
||||
}
|
||||
|
||||
async runTaskAndCheckErrors(root: IWorkspaceFolder | IWorkspace | undefined, taskId: string | TaskIdentifier | undefined, onError: (msg: string, actions: IAction[]) => Promise<void>): Promise<TaskRunResult> {
|
||||
try {
|
||||
this.canceled = false;
|
||||
const taskSummary = await this.runTask(root, taskId);
|
||||
if (this.canceled) {
|
||||
return TaskRunResult.Failure;
|
||||
}
|
||||
|
||||
const errorCount = taskId ? this.markerService.getStatistics().errors : 0;
|
||||
const successExitCode = taskSummary && taskSummary.exitCode === 0;
|
||||
|
||||
Reference in New Issue
Block a user