Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

228640: Hiding prelaunch task popup if the setting to hide it is enabled #231225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/debug/browser/debug.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ configurationRegistry.registerConfiguration({
type: 'boolean',
markdownDescription: nls.localize({ comment: ['This is the description for a setting'], key: 'debug.hideLauncherWhileDebugging' }, "Hide 'Start Debugging' control in title bar of 'Run and Debug' view while debugging is active. Only relevant when {0} is not `docked`.", '`#debug.toolBarLocation#`'),
default: false
},
'debug.hidePreLaunchNotification': {
type: 'boolean',
description: nls.localize('debug.hidePreLaunchNotification', "Hide preLaunchTask popup."),
default: false
}
}
});
Expand Down
51 changes: 27 additions & 24 deletions src/vs/workbench/contrib/debug/browser/debugTaskRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,33 +286,36 @@ export class DebugTaskRunner implements IDisposable {
}
}, waitTime));

// Notification shown on any task taking a while to resolve
store.add(disposableTimeout(() => {
const message = nls.localize('runningTask', "Waiting for preLaunchTask '{0}'...", task.configurationProperties.name);
const buttons = [DEBUG_ANYWAY_LABEL_NO_MEMO, ABORT_LABEL];
const canConfigure = task instanceof CustomTask || task instanceof ConfiguringTask;
if (canConfigure) {
buttons.splice(1, 0, nls.localize('configureTask', "Configure Task"));
}
const hidePreLaunchNotification = this.configurationService.getValue<IDebugConfiguration>('debug').hidePreLaunchNotification;
if (!hidePreLaunchNotification) {
// Notification shown on any task taking a while to resolve
store.add(disposableTimeout(() => {
const message = nls.localize('runningTask', "Waiting for preLaunchTask '{0}'...", task.configurationProperties.name);
const buttons = [DEBUG_ANYWAY_LABEL_NO_MEMO, ABORT_LABEL];
const canConfigure = task instanceof CustomTask || task instanceof ConfiguringTask;
if (canConfigure) {
buttons.splice(1, 0, nls.localize('configureTask', "Configure Task"));
}

this.progressService.withProgress(
{ location: ProgressLocation.Notification, title: message, buttons },
() => result.catch(() => { }),
(choice) => {
if (choice === undefined) {
// no-op, keep waiting
} else if (choice === 0) { // debug anyway
resolve({ exitCode: 0 });
} else { // abort or configure
resolve({ exitCode: undefined, cancelled: true });
this.taskService.terminate(task).catch(() => { });
if (canConfigure && choice === 1) { // configure
this.taskService.openConfig(task as CustomTask);
this.progressService.withProgress(
{ location: ProgressLocation.Notification, title: message, buttons },
() => result.catch(() => { }),
(choice) => {
if (choice === undefined) {
// no-op, keep waiting
} else if (choice === 0) { // debug anyway
resolve({ exitCode: 0 });
} else { // abort or configure
resolve({ exitCode: undefined, cancelled: true });
this.taskService.terminate(task).catch(() => { });
if (canConfigure && choice === 1) { // configure
this.taskService.openConfig(task as CustomTask);
}
}
}
}
);
}, 10_000));
);
}, 10_000));
}
}));
});

Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ export interface IDebugConfiguration {
autoExpandLazyVariables: 'auto' | 'off' | 'on';
enableStatusBarColor: boolean;
showVariableTypes: boolean;
hidePreLaunchNotification: boolean;
}

export interface IGlobalConfig {
Expand Down