Closed frytg closed 2 months ago
There is currently no way to disable eslint in zed, I think. It is baked into the typescript extension which is builtin. So if both is configured, they may be conflicting.
One limitation is currently, that the biome.json needs to sit in the root of the zed project to be seen by the biome language server.
You can also try to set source.fixAll.biome
instead, so it wont apply fixes from other language servers.
Can you provide a repo for reproduction?
Thanks for the quick feedback! I was able to see the Biome logs and verify that it properly picks up the config, but it seems that Zed is doing some interesting processing or doesn't properly trigger formatting. I'll create a repo to reproduce this issue this coming week.
There is currently no way to disable eslint in zed, I think. It is baked into the typescript extension which is builtin. So if both is configured, they may be conflicting.
I'm currently working on a fix for this (tracked by https://github.com/zed-industries/zed/issues/10906).
I just landed https://github.com/zed-industries/zed/pull/10911 to main
which will allow you to add this to your settings to disable the built-in TypeScript and ESLint language servers in favor of Biome:
{
"languages": {
"TypeScript": {
"language_servers": ["biome", "!typescript-language-server", "!eslint", "..."]
}
}
}
Will be shipping to Preview tomorrow.
Thats great! Though the biome lsp server should be used together with the ts-server, not instead. But we can finally disable eslint! ^^
Thats great! Though the biome lsp server should be used together with the ts-server, not instead. But we can finally disable eslint! ^^
Oh, for some reason I thought Biome had its own TS language server 😄
But yes, it can be used to disable ESLint!
Oh wow, that looks really promising, @maxdeviant and would probably solve the ranking issue with clashes of eslint vs. Biome! I'll keep an eye on the Preview version.
Hi @maxdeviant and @luckydye, I create this repository to demonstrate my use-case and errors: https://github.com/frytg/biome-zed-repro-temp
I hope this makes sense. I hope I didn't do any super dumb mistakes, which prevents this whole setup, but so far it seems quite hard and complicated to get Biome working in Zed.
@frytg awsome! I agree it should be very easy.
So the problem is, zed thinks the biome language server doesn't have the capability to run "textDocument/formatting", which is odd, cause it does.
I have a fix here: https://github.com/luckydye/zed/tree/biome-formatting-fix, but I think this would ignore any other language server that could format but is not the first priority.
Thats as far as I got for now...
Update: TLDR, formatting doesn't work because zed does not support dynamic register for formatting capabilities.
Is there an upstream issue for dynamic register of formatting caps?
We removed dynamic registration of formatting capabilities because not all clients support it.
Also, you can't have static and dynamic registration of the same capabilities, some clients like VSCode break.
I'm sorry I have to come back to this. I absolutely love the recent progress and developments of Zed, but the overall language server selection process still boggles me and will likely force me to switch back, since it's basically not working to configure and maintain a persistent experience
Also, there are so many open issues about this...
...that all seem to evolve aroung the same issues. Don't get me wrong, I don't want to criticize anyone's work, but what can we do to make this a pleasant and consistent experience? It takes 1min to configure the Biome plugin in VSCode and make it the default.
language_servers
is nowhere on zed.dev?Thank you all 🙌
but what can we do to make this a pleasant and consistent experience?
I don't want to disrespect anyone, especially you, but you know what's the answer :) But I'll try:
new defaults? zed-industries/zed@v0.141.2 (release)
This was released yesterday, I find really hard to fix it swiftly.
Overall, I am very displeased with your message, I don't feel any support for us volunteers. Thank you for your message
As someone who is not part of the inner works of Biome & Zed it is just hard to understand where the issue could be. Both are amazing tools, but at the moment I (and seemingly lots other people) don't understand the intended optiomal configuration and expected outcomes of the integration of those two. And that totally being aware of how young both projects are.
They will eventually reach a stable solution and good documentation.
Until then, patience.
Is there any configuration needed to make sure Zed is prefering Biome over native ESLint?
When I install the extension (
v0.0.2
) in Zed Preview (v0.131.4
), it creates a different formatting output in JS files vs. the Biome CLI. It seems like it is doing something when saving (adjusting spaces or so), but that seems to be more the output from ESLint or some other language server. Actually runningbunx biome format index.js --write
however reformats the whole file (replaces spaces with tabs, which also seems to be the default) - which would be the intended way.Is there any other way to debug or improve this?
This is in
settings.json
:Adding a
biome.json
with some arbitrary values likeformatter.indentWidth: 16
also shows that it doesn't get picked up, while the CLI replaces that.