tabby/clients/vscode/src/extension.ts

28 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-03-28 07:53:57 +00:00
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import { ExtensionContext, languages } from "vscode";
import { createAgentInstance } from "./agent";
import { tabbyCommands } from "./commands";
2023-03-28 07:53:57 +00:00
import { TabbyCompletionProvider } from "./TabbyCompletionProvider";
import { tabbyStatusBarItem } from "./statusBarItem";
2023-03-28 07:53:57 +00:00
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export async function activate(context: ExtensionContext) {
2023-03-28 07:53:57 +00:00
console.debug("Activating Tabby extension", new Date());
await createAgentInstance(context);
2023-03-28 07:53:57 +00:00
context.subscriptions.push(
languages.registerInlineCompletionItemProvider(
{ pattern: "**" },
new TabbyCompletionProvider()
),
tabbyStatusBarItem(),
...tabbyCommands(),
2023-03-28 07:53:57 +00:00
);
}
// this method is called when your extension is deactivated
export function deactivate() {
console.debug("Deactivating Tabby extension", new Date());
}