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

Extension runs in every project? #15

Open
silvenon opened this issue May 15, 2024 · 4 comments
Open

Extension runs in every project? #15

silvenon opened this issue May 15, 2024 · 4 comments

Comments

@silvenon
Copy link

silvenon commented May 15, 2024

Thanks su much for building an extension for Biome ❤️ That's really awesome of you, both Biome and Zed are so new, I didn't expect an extension would even exist!

One thing I noticed is that I'm getting Biome annotations in projects that don't use Biome, I didn't even know Biome can run without a config file.

I don't know Rust, but ChatGPT tells me that the extension script installs Biome if one isn't found in the depenedencies? Can we configure the extension to only run if the configuration file is found, or/and only if the extension exists in the dependencies?

Thanks!

@ematipico
Copy link
Member

One thing I noticed is that I'm getting Biome annotations in projects that don't use Biome, I didn't even know Biome can run without a config file.

Really?? It's literally in our homepage: https://biomejs.dev/
The first snippet you see, runs from npx without any configuration 😅

Can we configure the extension to only run if the configuration file is found, or/and only if the extension exists in the dependencies?

Not sure if it's possible at the moment with the current status of zed extensions. I don't know if zed exposes an API to read settings.json to the extensions .

@silvenon
Copy link
Author

silvenon commented May 15, 2024

I was migrating from away ESLint while burnt out, so I jumped straight into docs, that detail slipped past me 😄 But nice!

Until Zed provides some configuration leeway, isn't it safe to assume that if you don't have Biome installed in your project then you probably aren't using it? I feel like that's an ok compromise to make.

Otherwise I have to uninstall the extension when editing another project, and install it back when editing my Biome project, right?

@chungweileong94
Copy link
Contributor

Not sure if it's possible at the moment with the current status of zed extensions. I don't know if zed exposes an API to read settings.json to the extensions .

I did look into that before, zed seems to expose some LSP settings API for the extension author, but I wasn't able to get any further than that. However, my current workaround is to disable the biome LSP globally by default:

"language_servers": ["!biome", "..."]

Then enable in project setting .zed/settings.json:

"language_servers": ["..."]

@silvenon
Copy link
Author

That's a cool trick, and appears to be exactly what I wanted, thanks! 🥳

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