提交 40b59aa9 编写于 作者: I isidor

debug: renameFunctionBreakpoint

上级 cf4b2885
......@@ -222,7 +222,9 @@ export interface IDebugService extends ee.IEventEmitter {
clearBreakpoints(modelUri?: uri): Promise;
toggleBreakpointsActivated(): Promise;
sendAllBreakpoints(): Promise;
addFunctionBreakpoint(functionName?: string): Promise;
renameFunctionBreakpoint(id: string, newFunctionName: string): Promise;
removeFunctionBreakpoint(id: string): Promise;
addReplExpression(name: string): Promise;
......
......@@ -429,6 +429,14 @@ export class Model extends ee.EventEmitter implements debug.IModel {
this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED);
}
public renameFunctionBreakpoint(id: string, newFunctionName: string): void {
const fbp = this.functionBreakpoints.filter(bp => bp.getId() === id).pop();
if (fbp) {
fbp.name = newFunctionName;
this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED);
}
}
public removeFunctionBreakpoint(id: string): void {
this.functionBreakpoints = this.functionBreakpoints.filter(fbp => fbp.getId() != id);
this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED);
......
......@@ -412,6 +412,12 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return Promise.as(true);
}
public renameFunctionBreakpoint(id: string, newFunctionName: string): Promise {
this.model.renameFunctionBreakpoint(id, newFunctionName);
// TODO@Isidor send updated function breakpoints
return Promise.as(true);
}
public removeFunctionBreakpoint(id: string): Promise {
this.model.removeFunctionBreakpoint(id);
// TODO@Isidor send updated function breakpoints
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册