2018-01-27 20:30:03 -05:00
|
|
|
import { workspace } from "vscode";
|
|
|
|
import { ExtensionContext, WorkspaceConfiguration } from "vscode";
|
|
|
|
|
|
|
|
const onActivateHandlers: OnActivateHandler[] = [];
|
|
|
|
const onDeactivateHandlers: OnDeactivateHandler[] = [];
|
|
|
|
|
|
|
|
export function activate(context: ExtensionContext) {
|
|
|
|
const workspaceConfiguration = workspace.getConfiguration("xmlTools");
|
|
|
|
|
|
|
|
onActivateHandlers.forEach(x => x(context, workspaceConfiguration));
|
2018-01-27 17:50:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export function deactivate() {
|
2018-01-27 20:30:03 -05:00
|
|
|
onDeactivateHandlers.forEach(x => x());
|
|
|
|
}
|
|
|
|
|
|
|
|
export function onActivate(handler: OnActivateHandler): void {
|
|
|
|
onActivateHandlers.push(handler);
|
2018-01-27 18:01:04 -05:00
|
|
|
}
|
2018-01-27 20:30:03 -05:00
|
|
|
|
|
|
|
export function onDeactivate(handler: OnDeactivateHandler): void {
|
|
|
|
onDeactivateHandlers.push(handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
export type OnActivateHandler = (context: ExtensionContext, config: WorkspaceConfiguration) => void;
|
|
|
|
|
|
|
|
export type OnDeactivateHandler = () => void;
|