Skip to content

Commit

Permalink
register task disposables (#214512)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge authored Jun 7, 2024
1 parent f3c45e1 commit 64a3d79
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/vs/workbench/contrib/tasks/browser/task.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/se
import { ITaskEvent, TaskEventKind, TaskGroup, TaskSettingId, TASKS_CATEGORY, TASK_RUNNING_STATE } from 'vs/workbench/contrib/tasks/common/tasks';
import { ITaskService, TaskCommandsRegistered, TaskExecutionSupportedContext } from 'vs/workbench/contrib/tasks/common/taskService';

import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions';
import { RunAutomaticTasks, ManageAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/browser/runAutomaticTasks';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
Expand Down Expand Up @@ -431,15 +431,24 @@ schema.oneOf = [...(schemaVersion2.oneOf || []), ...(schemaVersion1.oneOf || [])
const jsonRegistry = <jsonContributionRegistry.IJSONContributionRegistry>Registry.as(jsonContributionRegistry.Extensions.JSONContribution);
jsonRegistry.registerSchema(tasksSchemaId, schema);

ProblemMatcherRegistry.onMatcherChanged(() => {
updateProblemMatchers();
jsonRegistry.notifySchemaChanged(tasksSchemaId);
});
export class TaskRegistryContribution extends Disposable implements IWorkbenchContribution {
static ID = 'taskRegistryContribution';
constructor() {
super();

this._register(ProblemMatcherRegistry.onMatcherChanged(() => {
updateProblemMatchers();
jsonRegistry.notifySchemaChanged(tasksSchemaId);
}));

this._register(TaskDefinitionRegistry.onDefinitionsChanged(() => {
updateTaskDefinitions();
jsonRegistry.notifySchemaChanged(tasksSchemaId);
}));
}
}
registerWorkbenchContribution2(TaskRegistryContribution.ID, TaskRegistryContribution, WorkbenchPhase.AfterRestored);

TaskDefinitionRegistry.onDefinitionsChanged(() => {
updateTaskDefinitions();
jsonRegistry.notifySchemaChanged(tasksSchemaId);
});

const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
configurationRegistry.registerConfiguration({
Expand Down

0 comments on commit 64a3d79

Please sign in to comment.