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

Enable biome only when biome.json is present gives error #59

Open
kjvdven opened this issue Oct 23, 2024 · 7 comments
Open

Enable biome only when biome.json is present gives error #59

kjvdven opened this issue Oct 23, 2024 · 7 comments

Comments

@kjvdven
Copy link

kjvdven commented Oct 23, 2024

I followed the docs to only Enable biome only when biome.json is present. And I added the following code to my config.

"lsp": {
    "biome": {
      "settings": {
        "require_config_file": true
      }
    },
}

Now I expected Biome to be disabled on projects without a config file.

But instead I get the following error;

Language server error: biome

biome.json is not found but require_config_file is true
-- stderr--

@luckydye
Copy link
Collaborator

It's a limitation of zed extensions at this time. There is currently no other way of canceling the server start, except by throwing an error.

If there if a better approach, PRs are welcome.

Otherwise, if you want to actually only enable the language_server in specific projects, follow this guide:
https://biomejs.dev/reference/zed/#project-based-configuration

@silvenon
Copy link

silvenon commented Oct 23, 2024

The require_config_file option lead me to believe that it's a solution to running the extension only in projects that use Biome, so maybe it would be better to withdraw this feature until it's actually possible to automatically not run the extension in projects where it's not installed.

@jbergstroem
Copy link

It's a limitation of zed extensions at this time. There is currently no other way of canceling the server start, except by throwing an error.

Is there a tracking issue for this?

@luckydye
Copy link
Collaborator

It's a limitation of zed extensions at this time. There is currently no other way of canceling the server start, except by throwing an error.

Is there a tracking issue for this?

I don't think so.

@kjvdven
Copy link
Author

kjvdven commented Oct 29, 2024

I did make an issue on the Zed repository.
zed-industries/zed#19589

@ematipico
Copy link
Member

Have you tried requireConfigFile?

@silvenon
Copy link

silvenon commented Oct 29, 2024

Have you tried requireConfigFile?

Instead of require_config_file? It doesn't prevent Biome from running in a non-Biome project, but unlike require_config_file something different happens — the extension manages to run Biome even though Biome is not installed that workspace. With require_config_file the extension itself fails in a non-Biome project 🤔

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

5 participants