Skip to content
Merged
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
13 changes: 9 additions & 4 deletions src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr
import { TerminalExitReason } from 'vs/platform/terminal/common/terminal';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { timeout } from 'vs/base/common/async';

const QUICKOPEN_HISTORY_LIMIT_CONFIG = 'task.quickOpen.history';
const PROBLEM_MATCHER_NEVER_CONFIG = 'task.problemMatchers.neverPrompt';
Expand Down Expand Up @@ -574,10 +575,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
// We need to first wait for extensions to be registered because we might read
// the `TaskDefinitionRegistry` in case `type` is `undefined`
await this._extensionService.whenInstalledExtensionsRegistered();

await Promise.all(
this._getActivationEvents(type).map(activationEvent => this._extensionService.activateByEvent(activationEvent))
);
// Wait for the first of either to resolve
await Promise.race([
// Create a promise that resolves when all activation promises resolve
Promise.all(
this._getActivationEvents(type).map(activationEvent => this._extensionService.activateByEvent(activationEvent))
),
timeout(5000).then(() => console.warn('Timed out activating extensions for task providers'))
]);
}

private _updateSetup(setup?: [IWorkspaceFolder[], IWorkspaceFolder[], ExecutionEngine, JsonSchemaVersion, IWorkspace | undefined]): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ namespace Configuration {

const taskDefinitionsExtPoint = ExtensionsRegistry.registerExtensionPoint<Configuration.ITaskDefinition[]>({
extensionPoint: 'taskDefinitions',
activationEventsGenerator: (contributions: Configuration.ITaskDefinition[], result: { push(item: string): void }) => {
for (const task of contributions) {
if (task.type) {
result.push(`onTaskType:${task.type}`);
}
}
},
jsonSchema: {
description: nls.localize('TaskDefinitionExtPoint', 'Contributes task kinds'),
type: 'array',
Expand Down