Files
devstar_plugin/src/main.ts
2024-07-16 23:28:56 +08:00

43 lines
973 B
TypeScript

import * as vscode from 'vscode';
import QuickAccessTreeProvider from './views/quick-access-tree';
import DSHome from './home';
export class SuperIDEExtension {
dsHome: DSHome;
constructor(private context: vscode.ExtensionContext) {
this.dsHome = new DSHome(context);
context.subscriptions.push(
vscode.window.registerTreeDataProvider(
'devstar.quickAccess',
new QuickAccessTreeProvider()
)
);
this.registerGlobalCommands(context);
this.startSuperIDEHome();
}
async startSuperIDEHome() {
vscode.commands.executeCommand('devstar.showHome');
}
registerGlobalCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('devstar.showHome', (url: string) =>
this.dsHome.toggle(url)
),
);
}
}
export function activate(context: vscode.ExtensionContext) {
return new SuperIDEExtension(context);
}
export function deactivate() {
}