From e01a48b16c2223d097ffa3a78511ac85f5a3564d Mon Sep 17 00:00:00 2001 From: "nsingh@pivotal.io" Date: Thu, 14 Nov 2019 14:04:59 -0800 Subject: [PATCH] PT 168776173 - Progress service improvements in vscode Fixed a bug and made some improvements in the vscode progress service such that messages for the same task id can be sent to the same open progress UI. Previously, the progress UI in vscode will close after the first message and it was not possible to have a continuous stream of progress messages appearing in the same open progress UI. --- .../commons-vscode/src/launch-util.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/vscode-extensions/commons-vscode/src/launch-util.ts b/vscode-extensions/commons-vscode/src/launch-util.ts index 2b599982c..ad4f3566f 100644 --- a/vscode-extensions/commons-vscode/src/launch-util.ts +++ b/vscode-extensions/commons-vscode/src/launch-util.ts @@ -338,7 +338,8 @@ interface MoveCursorResponse { } interface ProgressParams { - id: string + id: string + title: string statusMsg?: string } @@ -367,14 +368,24 @@ class ProgressService { handle(params: ProgressParams) { const progressHandler = this.status.get(params.id); if (progressHandler) { - progressHandler.complete(); + if(params.statusMsg) { + progressHandler.updateStatus(params.statusMsg, -1); + } else { + progressHandler.complete(); + } } else { if (params.statusMsg) { window.withProgress({ location: ProgressLocation.Notification, - title: params.statusMsg, + title: "", cancellable: false - }, progress => new Promise(resolve => this.status.set(params.id, new ProgressHandle(progress, resolve)))); + }, progress => new Promise(resolve => { + this.status.set(params.id, new ProgressHandle(progress, resolve)); + progress.report({ + message: params.statusMsg, + increment: -1 + }) + })); } }