File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { openTemplateInComposerCommand } from './commands/openTemplateInComposer
1010import { openInComposerDialogCommand } from './commands/openInComposerDialog'
1111
1212export async function activate ( extensionContext : vscode . ExtensionContext ) : Promise < void > {
13- const visualizationManager = new ApplicationComposerManager ( extensionContext )
13+ const visualizationManager = await ApplicationComposerManager . create ( extensionContext )
1414
1515 extensionContext . subscriptions . push (
1616 openTemplateInComposerCommand . register ( visualizationManager ) ,
Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ export class ApplicationComposerManager {
2323 protected readonly name : string = 'ApplicationComposerManager'
2424
2525 protected readonly managedVisualizations = new Map < string , ApplicationComposer > ( )
26- protected extensionContext : vscode . ExtensionContext
2726 protected webviewHtml ?: string
2827 protected readonly logger = getLogger ( )
2928
30- public constructor ( extensionContext : vscode . ExtensionContext ) {
31- this . extensionContext = extensionContext
32- void this . fetchWebviewHtml ( )
29+ private constructor ( protected extensionContext : vscode . ExtensionContext ) { }
30+
31+ public static async create ( extensionContext : vscode . ExtensionContext ) : Promise < ApplicationComposerManager > {
32+ const obj = new ApplicationComposerManager ( extensionContext )
33+ await obj . fetchWebviewHtml ( )
34+ return obj
3335 }
3436
3537 private async fetchWebviewHtml ( ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { WebviewContext } from '../../applicationcomposer/types'
1010import { MockDocument } from '../fake/fakeDocument'
1111
1212export async function createTemplate ( ) {
13- const manager = new ApplicationComposerManager ( globals . context )
13+ const manager = await ApplicationComposerManager . create ( globals . context )
1414 const panel = await manager . createTemplate ( )
1515 assert . ok ( panel )
1616 return panel
You can’t perform that action at this time.
0 commit comments