提交 5e4f976a 编写于 作者: I isidor

debug: remove all breakpoint removes also function breakpoints.

上级 11bc6762
...@@ -280,7 +280,7 @@ export class RemoveAllBreakpointsAction extends AbstractDebugAction { ...@@ -280,7 +280,7 @@ export class RemoveAllBreakpointsAction extends AbstractDebugAction {
} }
public run(): Promise { public run(): Promise {
return this.debugService.removeBreakpoints(); return Promise.join([this.debugService.removeBreakpoints(), this.debugService.removeFunctionBreakpoints()]);
} }
protected isEnabled(): boolean { protected isEnabled(): boolean {
......
...@@ -93,7 +93,7 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService: ...@@ -93,7 +93,7 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService:
} else if (element instanceof model.FunctionBreakpoint && renamed && inputBox.value) { } else if (element instanceof model.FunctionBreakpoint && renamed && inputBox.value) {
debugService.renameFunctionBreakpoint(element.getId(), inputBox.value).done(null, errors.onUnexpectedError); debugService.renameFunctionBreakpoint(element.getId(), inputBox.value).done(null, errors.onUnexpectedError);
} else if (element instanceof model.FunctionBreakpoint && !element.name) { } else if (element instanceof model.FunctionBreakpoint && !element.name) {
debugService.removeFunctionBreakpoint(element.getId()).done(null, errors.onUnexpectedError); debugService.removeFunctionBreakpoints(element.getId()).done(null, errors.onUnexpectedError);
} }
tree.clearHighlight(); tree.clearHighlight();
...@@ -905,7 +905,7 @@ export class BreakpointsController extends BaseDebugController { ...@@ -905,7 +905,7 @@ export class BreakpointsController extends BaseDebugController {
return true; return true;
} else if (element instanceof model.FunctionBreakpoint) { } else if (element instanceof model.FunctionBreakpoint) {
const fbp = <model.FunctionBreakpoint> element; const fbp = <model.FunctionBreakpoint> element;
this.debugService.removeFunctionBreakpoint(fbp.getId()).done(null, errors.onUnexpectedError); this.debugService.removeFunctionBreakpoints(fbp.getId()).done(null, errors.onUnexpectedError);
return true; return true;
} }
......
...@@ -225,7 +225,7 @@ export interface IDebugService extends ee.IEventEmitter { ...@@ -225,7 +225,7 @@ export interface IDebugService extends ee.IEventEmitter {
addFunctionBreakpoint(functionName?: string): Promise; addFunctionBreakpoint(functionName?: string): Promise;
renameFunctionBreakpoint(id: string, newFunctionName: string): Promise; renameFunctionBreakpoint(id: string, newFunctionName: string): Promise;
removeFunctionBreakpoint(id: string): Promise; removeFunctionBreakpoints(id?: string): Promise;
addReplExpression(name: string): Promise; addReplExpression(name: string): Promise;
clearReplExpressions(): void; clearReplExpressions(): void;
......
...@@ -437,8 +437,8 @@ export class Model extends ee.EventEmitter implements debug.IModel { ...@@ -437,8 +437,8 @@ export class Model extends ee.EventEmitter implements debug.IModel {
} }
} }
public removeFunctionBreakpoint(id: string): void { public removeFunctionBreakpoints(id?: string): void {
this.functionBreakpoints = this.functionBreakpoints.filter(fbp => fbp.getId() != id); this.functionBreakpoints = id ? this.functionBreakpoints.filter(fbp => fbp.getId() != id) : [];
this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED); this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED);
} }
......
...@@ -418,8 +418,8 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService ...@@ -418,8 +418,8 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return Promise.as(true); return Promise.as(true);
} }
public removeFunctionBreakpoint(id: string): Promise { public removeFunctionBreakpoints(id?: string): Promise {
this.model.removeFunctionBreakpoint(id); this.model.removeFunctionBreakpoints(id);
// TODO@Isidor send updated function breakpoints // TODO@Isidor send updated function breakpoints
return Promise.as(true); return Promise.as(true);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册