From dccb98826a7a307d7c50660d8ce941d55ad0aff7 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Thu, 25 Apr 2024 10:34:12 +0100 Subject: [PATCH] fix regression --- packages/@biomejs/js-api/src/index.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/@biomejs/js-api/src/index.ts b/packages/@biomejs/js-api/src/index.ts index fe1e26780621..430b70af9b16 100644 --- a/packages/@biomejs/js-api/src/index.ts +++ b/packages/@biomejs/js-api/src/index.ts @@ -101,7 +101,9 @@ export class Biome { public static async create(options: BiomeCreate): Promise { const module = await loadModule(options.distribution); const workspace = new module.Workspace(); - return new Biome(module, workspace); + const biome = new Biome(module, workspace); + biome.registerProjectFolder(); + return biome; } /** @@ -123,18 +125,24 @@ export class Biome { */ public applyConfiguration(configuration: Configuration): void { try { - this.workspace.registerProjectFolder({ - setAsCurrentWorkspace: true, - }); this.workspace.updateSettings({ configuration, gitignore_matches: [], + workspace_directory: "./", }); } catch (e) { throw wrapError(e); } } + public registerProjectFolder(): void; + public registerProjectFolder(path?: string): void { + this.workspace.registerProjectFolder({ + path, + setAsCurrentWorkspace: true, + }); + } + private tryCatchWrapper(func: () => T): T { try { return func();