forked from ex3ndr/llama-coder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.ts
31 lines (26 loc) · 1.15 KB
/
extension.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as vscode from 'vscode';
import { PromptProvider } from './prompts/provider';
import { info, registerLogger } from './modules/log';
export function activate(context: vscode.ExtensionContext) {
// Create logger
registerLogger(vscode.window.createOutputChannel('Llama Coder', { log: true }));
info('Llama Coder is activated.');
// Create status bar
const openSettings = 'llama.openSettings';
context.subscriptions.push(vscode.commands.registerCommand(openSettings, () => {
// const n = getNumberOfSelectedLines(vscode.window.activeTextEditor);
// vscode.window.showInformationMessage(`Yeah, ${n} line(s) selected... Keep going!`);
}));
let statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
statusBarItem.command = openSettings;
statusBarItem.text = `$(chip) Llama Coder`;
statusBarItem.show();
context.subscriptions.push(statusBarItem);
// Create provider
const provider = new PromptProvider(statusBarItem);
let disposable = vscode.languages.registerInlineCompletionItemProvider({ pattern: '**', }, provider);
context.subscriptions.push(disposable);
}
export function deactivate() {
// Nothing to do now
}