mirror of
https://github.com/Microsoft/vscode
synced 2024-09-12 21:24:38 +00:00
register task disposables (#214512)
This commit is contained in:
parent
f3c45e1c29
commit
64a3d795cb
|
@ -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 { 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 { 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 { RunAutomaticTasks, ManageAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/browser/runAutomaticTasks';
|
||||||
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||||
|
@ -431,15 +431,24 @@ schema.oneOf = [...(schemaVersion2.oneOf || []), ...(schemaVersion1.oneOf || [])
|
||||||
const jsonRegistry = <jsonContributionRegistry.IJSONContributionRegistry>Registry.as(jsonContributionRegistry.Extensions.JSONContribution);
|
const jsonRegistry = <jsonContributionRegistry.IJSONContributionRegistry>Registry.as(jsonContributionRegistry.Extensions.JSONContribution);
|
||||||
jsonRegistry.registerSchema(tasksSchemaId, schema);
|
jsonRegistry.registerSchema(tasksSchemaId, schema);
|
||||||
|
|
||||||
ProblemMatcherRegistry.onMatcherChanged(() => {
|
export class TaskRegistryContribution extends Disposable implements IWorkbenchContribution {
|
||||||
|
static ID = 'taskRegistryContribution';
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this._register(ProblemMatcherRegistry.onMatcherChanged(() => {
|
||||||
updateProblemMatchers();
|
updateProblemMatchers();
|
||||||
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
||||||
});
|
}));
|
||||||
|
|
||||||
TaskDefinitionRegistry.onDefinitionsChanged(() => {
|
this._register(TaskDefinitionRegistry.onDefinitionsChanged(() => {
|
||||||
updateTaskDefinitions();
|
updateTaskDefinitions();
|
||||||
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
||||||
});
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
registerWorkbenchContribution2(TaskRegistryContribution.ID, TaskRegistryContribution, WorkbenchPhase.AfterRestored);
|
||||||
|
|
||||||
|
|
||||||
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
|
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
|
||||||
configurationRegistry.registerConfiguration({
|
configurationRegistry.registerConfiguration({
|
||||||
|
|
Loading…
Reference in a new issue