zed
zed copied to clipboard
Newline between variables in list
Check for existing issues
- [X] Completed
Describe the feature
let a, b, c; // I want this
let a,
b,
c; // zed does this
Is there a way to configure that?
If applicable, add mockups / screenshots to help present your vision of the feature
No response
What language is that, JS?
Zed does not do anything to formatting itself, instead passing that onto prettier or the language server, depending on your set-up: check out formatter in your settings and, if there's nothing, in the default settings json to see the configuration options.
Refer to https://github.com/zed-industries/zed/discussions/7951#discussioncomment-8501391 for more explanation.
I don't see that behavior with default prettier, that's the thing: https://prettier.io/playground/
Also btw have you considered biome as default js formatter?
So, JS after all?
I know that Prettier default formatting logic had been different between versions, might be that the playground has something different in that regards.
If it's not prettier, then maybe it's a language server formatting? The "formatter" section in the settings should tell us more.
Another thing that can help debugging is an debug: open language server logs command that shows Prettier logs with all plugins and effective settings, if that file is indeed being formatted with it:
Biome had been proposed in https://github.com/zed-industries/zed/issues/4402 but that's all progress on that field so far.
It's JS, yes. What's the way to disable it at least? That pretty enforcement is really annoying - it reformatted a bunch of files across project I had to revert manually.
I am sorry for not being helpful here, I really struggle finding time for my own projects, cannot take on debugging... I just think enforcing someone's opinion about formatting without easy way to disable / change it is maybe not very liberal.
Sure, you can try setting the formatter option to something else, e.g. language_server or set the "format_on_save": "off",