提交 b1afb8d9 编写于 作者: I isidor

debug: add label and filter to exceptionBreakpoints

上级 94963c8b
......@@ -878,8 +878,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
}
private renderExceptionBreakpoint(exceptionBreakpoint: debug.IExceptionBreakpoint, data: IExceptionBreakpointTemplateData): void {
const namePascalCase = exceptionBreakpoint.name.charAt(0).toUpperCase() + exceptionBreakpoint.name.slice(1);
data.name.textContent = `${ namePascalCase} exceptions`;
data.name.textContent = exceptionBreakpoint.label || `${ exceptionBreakpoint.filter } exceptions`;;
data.checkbox.checked = exceptionBreakpoint.enabled;
}
......@@ -929,7 +928,7 @@ export class BreakpointsAccessibilityProvider implements tree.IAccessibilityProv
return nls.localize('functionBreakpointAriaLabel', "Funktion breakpoint {0}, breakpoints, debug", (<model.FunctionBreakpoint>element).name);
}
if (element instanceof model.ExceptionBreakpoint) {
return nls.localize('exceptionBreakpointAriaLabel', "Exception breakpoint {0}, breakpoints, debug", (<model.ExceptionBreakpoint>element).name);
return nls.localize('exceptionBreakpointAriaLabel', "Exception breakpoint {0}, breakpoints, debug", (<model.ExceptionBreakpoint>element).filter);
}
return null;
......
......@@ -93,7 +93,8 @@ export interface IFunctionBreakpoint extends IEnablement {
}
export interface IExceptionBreakpoint extends IEnablement {
name: string;
filter: string;
label: string;
}
// events
......
......@@ -320,7 +320,7 @@ export class ExceptionBreakpoint implements debug.IExceptionBreakpoint {
private id: string;
constructor(public name: string, public enabled: boolean) {
constructor(public filter: string, public label: string, public enabled: boolean) {
this.id = uuid.generateUuid();
}
......
......@@ -371,13 +371,14 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
let result: debug.IExceptionBreakpoint[] = null;
try {
result = JSON.parse(this.storageService.get(DEBUG_EXCEPTION_BREAKPOINTS_KEY, StorageScope.WORKSPACE, '[]')).map((exBreakpoint: any) => {
return new model.ExceptionBreakpoint(exBreakpoint.name, exBreakpoint.enabled);
return new model.ExceptionBreakpoint(exBreakpoint.filter || exBreakpoint.name, exBreakpoint.label, exBreakpoint.enabled);
});
} catch (e) {
result = [];
}
return result.length > 0 ? result : [new model.ExceptionBreakpoint('all', false), new model.ExceptionBreakpoint('uncaught', true)];
return result.length > 0 ? result : [new model.ExceptionBreakpoint('all', nls.localize('allExceptions', "All Exceptions"), false),
new model.ExceptionBreakpoint('uncaught', nls.localize('uncaughtExceptions', "Uncaught Exceptions"), true)];
}
private loadWatchExpressions(): model.Expression[] {
......@@ -863,7 +864,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}
const enabledExceptionBps = this.model.getExceptionBreakpoints().filter(exb => exb.enabled);
return this.session.setExceptionBreakpoints({ filters: enabledExceptionBps.map(exb => exb.name) });
return this.session.setExceptionBreakpoints({ filters: enabledExceptionBps.map(exb => exb.filter) });
}
private onFileChanges(fileChangesEvent: FileChangesEvent): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册