Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting BIOME_CONFIG_PATH breaks VSCode extension #2234

Closed
1 task done
david-04 opened this issue Mar 29, 2024 · 3 comments
Closed
1 task done

Setting BIOME_CONFIG_PATH breaks VSCode extension #2234

david-04 opened this issue Mar 29, 2024 · 3 comments

Comments

@david-04
Copy link

Environment information

CLI:
  Version:                      1.6.1
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "cygwin"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

  1. Set environment variable BIOME_CONFIG_PATH to a custom default configuration file (e.g. C:\MyFiles\biome.default.json).
  2. Start VSCode (with the Biome VSCode extension installed and Biome configured as the default formatter for TypeScript).
  3. Open a TypeScript project (with or without a local biome.json) and try to format a TypeScript file.
  4. Formatting fails and an error message pops up, stating that Extension 'Biome' is configured as formatter but it cannot format 'TypeScript'-files

Expected result

Biome should format the code. If the project has a biome.json, it should use the configuration from there. If the project does not have a Biome configuration, it should use the file specified in the BIOME_CONFIG_PATH.

The environment variable was a good way to define a default configuration that's applied when a VSCode project does not have a local Biome configuration. It has stopped working some time ago. Setting BIOME_CONFIG_PATH now prevents the VSCode extension from working at all (even if the project has a local biome.json).

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@david-04 david-04 changed the title Settinig BIOME_CONFIG_PATH breaks VSCode extension Setting BIOME_CONFIG_PATH breaks VSCode extension Mar 29, 2024
@benhammondmusic
Copy link

This or something similar is happening on my Mac setup as well

@nhedger
Copy link
Member

nhedger commented Mar 30, 2024

Hi,

Thanks for opening this issue.

The BIOME_CONFIG_PATH environment variable expects a path to a directory, not a file.

It could be why Biome fails to start, resulting in the VS Code extension behaving like this.

@david-04
Copy link
Author

Thanks for the clarification, Nicolas. It does work as expected when BIOME_CONFIG_PATH points to the directory rather than the file. I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants