Skip to content

Commit

Permalink
update ActivitybarProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Nov 28, 2024
1 parent 06f5b1a commit 9b51a86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import * as vscode from 'vscode';
import { ActivitybarProvider } from './webview/activitybarProvider';
import { initActivityBar } from './webview/activitybarProvider';

export function activate(context: vscode.ExtensionContext) {
const provider = new ActivitybarProvider(context);
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(
ActivitybarProvider.viewType,
provider,
),
);
initActivityBar(context);
context.subscriptions.push(
vscode.commands.registerCommand('aptos-extension.openDocs', () => {
vscode.env.openExternal(vscode.Uri.parse('https://docs.zktx.io'));
Expand Down
13 changes: 11 additions & 2 deletions src/webview/activitybarProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
MoveToml,
} from './activitybar/src/utilities/cli';

export class ActivitybarProvider implements vscode.WebviewViewProvider {
public static readonly viewType = 'activitybarProviderAptos';
class ActivitybarProvider implements vscode.WebviewViewProvider {
private _view?: vscode.WebviewView;

private readonly _context;
Expand Down Expand Up @@ -203,3 +202,13 @@ export class ActivitybarProvider implements vscode.WebviewViewProvider {
`;
}
}

export const initActivityBar = (context: vscode.ExtensionContext) => {
const provider = new ActivitybarProvider(context);
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(
'activitybarProviderAptos',
provider,
),
);
};

0 comments on commit 9b51a86

Please sign in to comment.