Skip to content

🐛 Multiple biome entries from vscode workspace causes corrupted formatting #817

@Jylth

Description

@Jylth

VS Code version

1.104

Extension version

3.2.0

Biome version

2.2.6

Operating system

  • Windows
  • macOS
  • Linux

Description

Hello,

In vscode when htting cmd+shift+p and selecting "Format document with..." multiple biome entries show up in the list, in my case always 2 entries.

This only happens in a VS Code workspace with multiple folders, where one of the folders is pointing to the root of the project. Here is a comment from myself which explains how to reproduce this issue:

biomejs/biome#1584 (comment)

This seems to cause random issues where formatting files randomly break the file by adding duplicate bad code at the end of the file or messing up imports. I tested a full week of work without having my Root folder, so by removing the multiple biome instance issue, and could not encounter any of those random bugs when formatting a file. I assume the multiple biome instances are causing this.

This makes using the vscode biome extension a big hassle, if I remove those random issues by removing the Root folder then I won't have access to a good UX in my monorepo (git disabled, root file exploration missing etc). Working with the bug active is maybe even worse because of those random file corruption which seems to happen every 5-10 minutes and makes you lose time correcting those files.

Steps to reproduce

  1. Setup a workspace with multiple folders where one of the folders is pointing to the root of the project
  2. Add biome at the root of the project only. No other folder has biome installed
  3. Hit cmd+shift+P, click on "Format document with...", see multiple entries of biome appear
  4. You can remove the multiple entries bug by simple removing the Root folder from the workspace settings
  5. The double biome entries seem to conflict with each other and causes random file corruption issues when formatting.

Expected behavior

No multiple biome entries show up when having a Root folder in my workspace settings and hitting "Format document with...".
No formatting bugs which corrupts files which seems to be linked to those multiple biome instances conflicting.

Does this issue occur when using the CLI directly?

No

Link to a minimal reproduction

https://github.com/Jylth/biome_multiple_entries_vscode_workspace_repro.git

  1. Open the workspace file using vscode
  2. pnpm install
  3. Hit cmd+shift+P => "Format document with...", see multiple biome entries

Logs

No errors in the logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug confirmedReport has been confirmed as a valid bugHelp wantedExternal contributions are welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions