From 879fa61153c8cb050785e080486697d31f511a86 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 28 Oct 2016 16:07:13 +0200 Subject: [PATCH] debug: no need for model.clearWatchExpressions --- src/vs/workbench/parts/debug/common/debugModel.ts | 9 --------- .../parts/debug/electron-browser/debugService.ts | 8 ++------ .../workbench/parts/debug/test/node/debugModel.test.ts | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 8f0e4f49cec..6c6d90aeb5e 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -919,15 +919,6 @@ export class Model implements debug.IModel { }); } - public clearWatchExpressionValues(): void { - this.watchExpressions.forEach(we => { - we.value = Expression.DEFAULT_VALUE; - we.available = false; - }); - - this._onDidChangeWatchExpressions.fire(); - } - public removeWatchExpressions(id: string = null): void { this.watchExpressions = id ? this.watchExpressions.filter(we => we.getId() !== id) : []; this._onDidChangeWatchExpressions.fire(); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 7b44c769d3b..b46b28bca56 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -450,12 +450,8 @@ export class DebugService implements debug.IDebugService { this.viewModel.setFocusedStackFrame(focusedStackFrame, process); this._onDidChangeState.fire(); - if (focusedStackFrame) { - return this.model.evaluateWatchExpressions(process, focusedStackFrame); - } else { - this.model.clearWatchExpressionValues(); - return TPromise.as(null); - } + + return this.model.evaluateWatchExpressions(process, focusedStackFrame); } public enableOrDisableBreakpoints(enable: boolean, breakpoint?: debug.IEnablement): TPromise { diff --git a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts index 09b8b2ae9a6..889ee4a6a9c 100644 --- a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts +++ b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts @@ -303,7 +303,7 @@ suite('Debug - Model', () => { model.renameWatchExpression(process, stackFrame, watchExpressions[1].getId(), 'new_name').done(); assertWatchExpressions(model.getWatchExpressions(), 'new_name'); - model.clearWatchExpressionValues(); + model.evaluateWatchExpressions(process, null); assertWatchExpressions(model.getWatchExpressions(), 'new_name'); model.removeWatchExpressions(); -- GitLab