提交 5de3aa7e 编写于 作者: I isidor

fixes #100847

上级 d8c66be4
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册