Skip to content

Commit

Permalink
fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 25, 2024
1 parent 830f8d8 commit dccb988
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/@biomejs/js-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export class Biome {
public static async create(options: BiomeCreate): Promise<Biome> {
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;
}

/**
Expand All @@ -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<T>(func: () => T): T {
try {
return func();
Expand Down

0 comments on commit dccb988

Please sign in to comment.