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

if there's more than one default build task, activate all providers #223147

Merged
merged 2 commits into from
Jul 22, 2024
Merged
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
21 changes: 9 additions & 12 deletions src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,25 +316,22 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
this._registerCommands().then(() => TaskCommandsRegistered.bindTo(this._contextKeyService).set(true));
ServerlessWebContext.bindTo(this._contextKeyService).set(Platform.isWeb && !remoteAgentService.getConnection()?.remoteAuthority);
this._configurationResolverService.contributeVariable('defaultBuildTask', async (): Promise<string | undefined> => {
// delay provider activation, we might find a default task in the tasks.json file
// delay provider activation, we might find a single default build task in the tasks.json file
let tasks = await this._getTasksForGroup(TaskGroup.Build, true);
if (tasks.length > 0) {
const defaults = this._getDefaultTasks(tasks);
if (defaults.length === 1) {
return defaults[0]._label;
} else if (defaults.length) {
tasks = defaults;
}
} else {
// activate all providers, we haven't found the default build task in the tasks.json file
tasks = await this._getTasksForGroup(TaskGroup.Build);
const defaults = this._getDefaultTasks(tasks);
if (defaults.length === 1) {
return defaults[0]._label;
} else if (defaults.length) {
tasks = defaults;
}
}
// activate all providers, we haven't found the default build task in the tasks.json file
tasks = await this._getTasksForGroup(TaskGroup.Build);
const defaults = this._getDefaultTasks(tasks);
if (defaults.length === 1) {
return defaults[0]._label;
} else if (defaults.length) {
tasks = defaults;
}

let entry: ITaskQuickPickEntry | null | undefined;
if (tasks && tasks.length > 0) {
Expand Down
Loading