import type { ActivateContext, IdeAPluginModule } from "@idea/plugin-sdk";

export function activate(ctx: ActivateContext): void {
  ctx.logger.info("Hello from the IdeA hello plugin.");

  const disposable = ctx.commands?.registerCommand("hello-plugin.sayHello", () => {
    ctx.logger.info("Hello command executed.");
    return "Hello from IdeA";
  });

  if (disposable) {
    ctx.subscriptions.push(disposable);
  }
}

const plugin: IdeAPluginModule = {
  activate
};

export default plugin;

