fixes #90478
This commit is contained in:
parent
0f7880a7ca
commit
33d3f3ae4b
|
@ -262,8 +262,8 @@ configurationRegistry.registerConfiguration({
|
|||
default: true
|
||||
},
|
||||
'debug.onTaskErrors': {
|
||||
enum: ['debugAnyway', 'showErrors', 'prompt'],
|
||||
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user.")],
|
||||
enum: ['debugAnyway', 'showErrors', 'prompt', 'cancel'],
|
||||
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user."), nls.localize('cancel', "Cancel debugging.")],
|
||||
description: nls.localize('debug.onTaskErrors', "Controls what to do when errors are encountered after running a preLaunchTask."),
|
||||
default: 'prompt'
|
||||
},
|
||||
|
|
|
@ -72,6 +72,9 @@ export class DebugTaskRunner {
|
|||
await this.viewsService.openView(Constants.MARKERS_VIEW_ID);
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
if (onTaskErrors === 'cancel') {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
|
||||
const taskLabel = typeof taskId === 'string' ? taskId : taskId ? taskId.name : '';
|
||||
const message = errorCount > 1
|
||||
|
@ -89,12 +92,15 @@ export class DebugTaskRunner {
|
|||
cancelId: 2
|
||||
});
|
||||
|
||||
if (result.choice === 2) {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
|
||||
const debugAnyway = result.choice === 0;
|
||||
const cancel = result.choice = 2;
|
||||
if (result.checkboxChecked) {
|
||||
this.configurationService.updateValue('debug.onTaskErrors', debugAnyway ? 'debugAnyway' : 'showErrors');
|
||||
this.configurationService.updateValue('debug.onTaskErrors', result.choice === 0 ? 'debugAnyway' : cancel ? 'cancel' : 'showErrors');
|
||||
}
|
||||
|
||||
if (cancel) {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
if (debugAnyway) {
|
||||
return TaskRunResult.Success;
|
||||
|
|
|
@ -467,7 +467,7 @@ export interface IDebugConfiguration {
|
|||
closeOnEnd: boolean;
|
||||
};
|
||||
focusWindowOnBreak: boolean;
|
||||
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt';
|
||||
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt' | 'cancel';
|
||||
showBreakpointsInOverviewRuler: boolean;
|
||||
showInlineBreakpointCandidates: boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue