Files
devstar_plugin/src/main.ts

43 lines
973 B
TypeScript
Raw Normal View History

import * as vscode from 'vscode';
import QuickAccessTreeProvider from './views/quick-access-tree';
import DSHome from './home';
2024-06-27 01:20:37 +08:00
2024-07-02 12:15:39 +08:00
export class SuperIDEExtension {
dsHome: DSHome;
2024-06-27 01:20:37 +08:00
2024-07-02 12:15:39 +08:00
constructor(private context: vscode.ExtensionContext) {
this.dsHome = new DSHome(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(
'devstar.quickAccess',
2024-06-27 01:20:37 +08:00
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('devstar.showHome');
2024-06-27 01:20:37 +08:00
}
2024-07-02 12:15:39 +08:00
registerGlobalCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('devstar.showHome', (url: string) =>
this.dsHome.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() {
}