From 5e4f976ac41772b5b1544f8609d9e783234305c5 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 27 Nov 2015 19:55:33 +0100 Subject: [PATCH] debug: remove all breakpoint removes also function breakpoints. --- src/vs/workbench/parts/debug/browser/debugActions.ts | 2 +- src/vs/workbench/parts/debug/browser/debugViewer.ts | 4 ++-- src/vs/workbench/parts/debug/common/debug.ts | 2 +- src/vs/workbench/parts/debug/common/debugModel.ts | 4 ++-- src/vs/workbench/parts/debug/electron-browser/debugService.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index e7897e90495..808d2d4ec24 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -280,7 +280,7 @@ export class RemoveAllBreakpointsAction extends AbstractDebugAction { } public run(): Promise { - return this.debugService.removeBreakpoints(); + return Promise.join([this.debugService.removeBreakpoints(), this.debugService.removeFunctionBreakpoints()]); } protected isEnabled(): boolean { diff --git a/src/vs/workbench/parts/debug/browser/debugViewer.ts b/src/vs/workbench/parts/debug/browser/debugViewer.ts index 3230169eeeb..a81750767b9 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewer.ts @@ -93,7 +93,7 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService: } else if (element instanceof model.FunctionBreakpoint && renamed && inputBox.value) { debugService.renameFunctionBreakpoint(element.getId(), inputBox.value).done(null, errors.onUnexpectedError); } 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(); @@ -905,7 +905,7 @@ export class BreakpointsController extends BaseDebugController { return true; } else if (element instanceof model.FunctionBreakpoint) { const fbp = element; - this.debugService.removeFunctionBreakpoint(fbp.getId()).done(null, errors.onUnexpectedError); + this.debugService.removeFunctionBreakpoints(fbp.getId()).done(null, errors.onUnexpectedError); return true; } diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 5d89d1e465f..65927a6c39e 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -225,7 +225,7 @@ export interface IDebugService extends ee.IEventEmitter { addFunctionBreakpoint(functionName?: string): Promise; renameFunctionBreakpoint(id: string, newFunctionName: string): Promise; - removeFunctionBreakpoint(id: string): Promise; + removeFunctionBreakpoints(id?: string): Promise; addReplExpression(name: string): Promise; clearReplExpressions(): void; diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index fcd840d19d6..985cfa0a4b6 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -437,8 +437,8 @@ export class Model extends ee.EventEmitter implements debug.IModel { } } - public removeFunctionBreakpoint(id: string): void { - this.functionBreakpoints = this.functionBreakpoints.filter(fbp => fbp.getId() != id); + public removeFunctionBreakpoints(id?: string): void { + this.functionBreakpoints = id ? this.functionBreakpoints.filter(fbp => fbp.getId() != id) : []; this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 56491faca1e..28c52b54112 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -418,8 +418,8 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService return Promise.as(true); } - public removeFunctionBreakpoint(id: string): Promise { - this.model.removeFunctionBreakpoint(id); + public removeFunctionBreakpoints(id?: string): Promise { + this.model.removeFunctionBreakpoints(id); // TODO@Isidor send updated function breakpoints return Promise.as(true); } -- GitLab