diff --git a/src/vs/workbench/contrib/debug/browser/debugProgress.ts b/src/vs/workbench/contrib/debug/browser/debugProgress.ts index 9b7d893b385c1c9dbdc62bb98d446d8603abfbee..6a8ef0397c2bdf691900ecd38bf31e6b27604acd 100644 --- a/src/vs/workbench/contrib/debug/browser/debugProgress.ts +++ b/src/vs/workbench/contrib/debug/browser/debugProgress.ts @@ -8,14 +8,16 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IDebugService, VIEWLET_ID, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { IViewsService } from 'vs/workbench/common/views'; export class DebugProgressContribution implements IWorkbenchContribution { private toDispose: IDisposable[] = []; constructor( - @IDebugService private readonly debugService: IDebugService, - @IProgressService private readonly progressService: IProgressService + @IDebugService debugService: IDebugService, + @IProgressService progressService: IProgressService, + @IViewsService viewsService: IViewsService ) { let progressListener: IDisposable | undefined; const listenOnProgress = (session: IDebugSession | undefined) => { @@ -34,9 +36,11 @@ export class DebugProgressContribution implements IWorkbenchContribution { }); }); - this.progressService.withProgress({ location: VIEWLET_ID }, () => promise); - const source = this.debugService.getConfigurationManager().getDebuggerLabel(session.configuration.type); - this.progressService.withProgress({ + if (viewsService.isViewContainerVisible(VIEWLET_ID)) { + progressService.withProgress({ location: VIEWLET_ID }, () => promise); + } + const source = debugService.getConfigurationManager().getDebuggerLabel(session.configuration.type); + progressService.withProgress({ location: ProgressLocation.Notification, title: progressStartEvent.body.title, cancellable: progressStartEvent.body.cancellable, @@ -72,9 +76,9 @@ export class DebugProgressContribution implements IWorkbenchContribution { }); } }; - this.toDispose.push(this.debugService.getViewModel().onDidFocusSession(listenOnProgress)); - listenOnProgress(this.debugService.getViewModel().focusedSession); - this.toDispose.push(this.debugService.onWillNewSession(session => { + this.toDispose.push(debugService.getViewModel().onDidFocusSession(listenOnProgress)); + listenOnProgress(debugService.getViewModel().focusedSession); + this.toDispose.push(debugService.onWillNewSession(session => { if (!progressListener) { listenOnProgress(session); }