From 1deda3c776b3ce06e5c9099bf4b0a4283474d5eb Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 1 Apr 2020 15:37:41 +0200 Subject: [PATCH] Show initial message from progressStart fixes #94014 --- .../contrib/debug/browser/debugProgress.ts | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugProgress.ts b/src/vs/workbench/contrib/debug/browser/debugProgress.ts index 45a03b3dd32..6b4b9b85432 100644 --- a/src/vs/workbench/contrib/debug/browser/debugProgress.ts +++ b/src/vs/workbench/contrib/debug/browser/debugProgress.ts @@ -44,16 +44,24 @@ export class DebugProgressContribution implements IWorkbenchContribution { delay: 500 }, progressStep => { let increment = 0; + const reportProgress = (progress: { message?: string, percentage?: number }) => { + if (typeof progress.percentage === 'number') { + increment = progress.percentage - increment; + } + progressStep.report({ + message: progress.message, + increment: typeof progress.percentage === 'number' ? increment : undefined, + total: typeof progress.percentage === 'number' ? 100 : undefined, + }); + }; + + if (progressStartEvent.body.message) { + reportProgress(progressStartEvent.body); + } const progressUpdateListener = session.onDidProgressUpdate(e => { if (e.body.progressId === progressStartEvent.body.progressId) { - if (typeof e.body.percentage === 'number') { - increment = e.body.percentage - increment; - } - progressStep.report({ - message: e.body.message, - increment: typeof e.body.percentage === 'number' ? increment : undefined, - total: typeof e.body.percentage === 'number' ? 100 : undefined, - }); + + reportProgress(e.body); } }); -- GitLab