From 963783b8eda3b7007fde752a2473815b0a8921d2 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 8 Mar 2017 18:07:35 +0100 Subject: [PATCH] debug: only one evaluate on new watch expression fixes #21524 --- src/vs/workbench/parts/debug/common/debugModel.ts | 3 ++- src/vs/workbench/parts/debug/electron-browser/debugService.ts | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 212ba1b34b4..0859338d2fc 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -927,7 +927,8 @@ export class Model implements debug.IModel { const filtered = this.watchExpressions.filter(we => we.getId() === id); if (filtered.length === 1) { filtered[0].name = newName; - return filtered[0].evaluate(process, stackFrame, 'watch').then(() => { + // Evaluate all watch expressions again since the new watch expression might have changed some. + return this.evaluateWatchExpressions(process, stackFrame).then(() => { this._onDidChangeWatchExpressions.fire(filtered[0]); }); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index ff306e51fec..f8f409941bd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -548,9 +548,7 @@ export class DebugService implements debug.IDebugService { } public renameWatchExpression(id: string, newName: string): TPromise { - return this.model.renameWatchExpression(this.viewModel.focusedProcess, this.viewModel.focusedStackFrame, id, newName) - // Evaluate all watch expressions and fetch variables again since watch expression evaluation might have changed some. - .then(() => this.focusStackFrameAndEvaluate(this.viewModel.focusedStackFrame, this.viewModel.focusedProcess)); + return this.model.renameWatchExpression(this.viewModel.focusedProcess, this.viewModel.focusedStackFrame, id, newName); } public moveWatchExpression(id: string, position: number): void { -- GitLab