Skip to content

Commit

Permalink
fix: fill workspace provider even if other fields are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Apr 16, 2024
1 parent d1cad30 commit 7572132
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,16 @@ export function isInitialized (): boolean {
return initialized
}

export async function initialize (constructionOptions?: IWorkbenchConstructionOptions, container?: HTMLElement): Promise<void> {
export async function initialize (constructionOptions: IWorkbenchConstructionOptions = {}, container?: HTMLElement): Promise<void> {
if (typeof process !== 'undefined') {
console.warn('`process` detected. It may have negative impacts on VSCode behavior')
}

constructionOptions ??= {
workspaceProvider: await generateAndInitializeWorkspace()
if (constructionOptions.workspaceProvider == null) {
constructionOptions = {
...constructionOptions,
workspaceProvider: await generateAndInitializeWorkspace()
}
}

await initializeServices(services, container, constructionOptions)
Expand Down

0 comments on commit 7572132

Please sign in to comment.