diff --git a/src/extension.ts b/src/extension.ts index 14c2e3c..b3ea275 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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')); diff --git a/src/webview/activitybarProvider.ts b/src/webview/activitybarProvider.ts index 59ae969..4d66774 100644 --- a/src/webview/activitybarProvider.ts +++ b/src/webview/activitybarProvider.ts @@ -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; @@ -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, + ), + ); +};