2024-07-11 12:42:23 +08:00
|
|
|
import * as vscode from 'vscode';
|
2024-07-01 12:25:28 +08:00
|
|
|
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) {
|
2024-07-03 11:55:49 +08:00
|
|
|
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(
|
2024-07-11 12:42:23 +08:00
|
|
|
vscode.commands.registerCommand('superide.showHome', (url: string) =>
|
2024-07-01 12:25:28 +08:00
|
|
|
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() {
|
|
|
|
}
|