From a3d17e4184af2ceff0eb36ad2bc706f54163da4d Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 1 Apr 2020 15:51:37 +0200 Subject: [PATCH] Debug progress do proper math for increment calc fixes #94015 --- .../workbench/contrib/debug/browser/debugProgress.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugProgress.ts b/src/vs/workbench/contrib/debug/browser/debugProgress.ts index 6b4b9b85432..ec8e239c141 100644 --- a/src/vs/workbench/contrib/debug/browser/debugProgress.ts +++ b/src/vs/workbench/contrib/debug/browser/debugProgress.ts @@ -43,15 +43,17 @@ export class DebugProgressContribution implements IWorkbenchContribution { source, delay: 500 }, progressStep => { - let increment = 0; + let total = 0; const reportProgress = (progress: { message?: string, percentage?: number }) => { + let increment = undefined; if (typeof progress.percentage === 'number') { - increment = progress.percentage - increment; + increment = progress.percentage - total; + total += increment; } progressStep.report({ message: progress.message, - increment: typeof progress.percentage === 'number' ? increment : undefined, - total: typeof progress.percentage === 'number' ? 100 : undefined, + increment, + total: typeof increment === 'number' ? 100 : undefined, }); }; @@ -60,7 +62,6 @@ export class DebugProgressContribution implements IWorkbenchContribution { } const progressUpdateListener = session.onDidProgressUpdate(e => { if (e.body.progressId === progressStartEvent.body.progressId) { - reportProgress(e.body); } }); -- GitLab