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";
|
2023-09-26 10:01:38 +00:00
|
|
|
import { createAgentInstance, disposeAgentInstance } from "./agent";
|
2023-06-15 15:53:21 +00:00
|
|
|
import { tabbyCommands } from "./commands";
|
2023-03-28 07:53:57 +00:00
|
|
|
import { TabbyCompletionProvider } from "./TabbyCompletionProvider";
|
2023-09-19 09:01:36 +00:00
|
|
|
import { TabbyStatusBarItem } from "./TabbyStatusBarItem";
|
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
|
2023-06-15 15:53:21 +00:00
|
|
|
export async function activate(context: ExtensionContext) {
|
2023-03-28 07:53:57 +00:00
|
|
|
console.debug("Activating Tabby extension", new Date());
|
2023-06-15 15:53:21 +00:00
|
|
|
await createAgentInstance(context);
|
2023-09-25 01:07:25 +00:00
|
|
|
const completionProvider = TabbyCompletionProvider.getInstance();
|
2023-09-19 09:01:36 +00:00
|
|
|
const statusBarItem = new TabbyStatusBarItem(completionProvider);
|
2023-03-28 07:53:57 +00:00
|
|
|
context.subscriptions.push(
|
2023-09-19 09:01:36 +00:00
|
|
|
languages.registerInlineCompletionItemProvider({ pattern: "**" }, completionProvider),
|
|
|
|
|
statusBarItem.register(),
|
2023-06-15 15:53:21 +00:00
|
|
|
...tabbyCommands(),
|
2023-03-28 07:53:57 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this method is called when your extension is deactivated
|
2023-09-26 10:01:38 +00:00
|
|
|
export async function deactivate() {
|
2023-03-28 07:53:57 +00:00
|
|
|
console.debug("Deactivating Tabby extension", new Date());
|
2023-09-26 10:01:38 +00:00
|
|
|
await disposeAgentInstance();
|
2023-03-28 07:53:57 +00:00
|
|
|
}
|