This commit is contained in:
isidor 2020-02-12 12:02:23 +01:00
parent 0f7880a7ca
commit 33d3f3ae4b
3 changed files with 13 additions and 7 deletions

View file

@ -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'
},

View file

@ -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;

View file

@ -467,7 +467,7 @@ export interface IDebugConfiguration {
closeOnEnd: boolean;
};
focusWindowOnBreak: boolean;
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt';
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt' | 'cancel';
showBreakpointsInOverviewRuler: boolean;
showInlineBreakpointCandidates: boolean;
}