Files
devstar_plugin/src/main.ts

43 lines
976 B
TypeScript
Raw Normal View History

import * as vscode from 'vscode';
import QuickAccessTreeProvider from './views/quick-access-tree';
import SIHome from './home';
2024-06-27 01:20:37 +08:00
2024-07-02 12:15:39 +08:00
export class SuperIDEExtension {
siHome: SIHome;
2024-06-27 01:20:37 +08:00
2024-07-02 12:15:39 +08:00
constructor(private context: vscode.ExtensionContext) {
this.siHome = new SIHome(context);
2024-06-27 01:20:37 +08:00
2024-07-02 12:15:39 +08:00
context.subscriptions.push(
2024-06-27 01:20:37 +08:00
vscode.window.registerTreeDataProvider(
'superide.quickAccess',
new QuickAccessTreeProvider()
)
);
2024-07-02 12:15:39 +08:00
this.registerGlobalCommands(context);
2024-06-27 01:20:37 +08:00
this.startSuperIDEHome();
}
async startSuperIDEHome() {
vscode.commands.executeCommand('superide.showHome');
}
2024-07-02 12:15:39 +08:00
registerGlobalCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('superide.showHome', (url: string) =>
this.siHome.toggle(url)
),
2024-06-27 01:20:37 +08:00
);
}
}
2024-07-02 12:15:39 +08:00
export function activate(context: vscode.ExtensionContext) {
return new SuperIDEExtension(context);
2024-06-27 01:20:37 +08:00
}
export function deactivate() {
}