Builtin Zed prettier does not respect zed "tab_width" options #20235
Labels
bug
[core label]
discoverability
Feedback for discoverability of features, settings, etc
editor
Feedback for code editing, formatting, editor iterations, etc
prettier
Prettier tooling support
Check for existing issues
Describe the bug / provide steps to reproduce it
The
tab_size
option is set to 4 by default (both globally and for javascript in particular) and the autoformatting on save is on by default. Open a Javascript file, ensure the indents are 4 spaces, save the file. The indents are changed to a tab size of 2. This is because the in-built prettier (allowed by default) has its owntab_width
defaults, which are set to 2. This can be overridden in the zed config with:However, this is extremely confusing and most users would expect
tab_size
at the top level, or at the language level to override the built-in prettier configuration.This may be related to #12154 and #20009.
Environment
Zed: v0.159.7 (Zed)
OS: Linux Wayland gentoo 2.15
Memory: 15.3 GiB
Architecture: x86_64
GPU: Intel(R) UHD Graphics (TGL GT1) || Intel open-source Mesa driver || Mesa 24.2.6
If applicable, add mockups / screenshots to help explain present your vision of the feature
In my view, javascript files, when saved by default, should adhere to the tab_width defaults of zed.
If applicable, attach your Zed.log file to this issue.
Not applicable, although when saving a broken JSON settings file, I discovered the following line:
Which caused me to investigate
prettierOptions
and eventually find thatprettier
has its owntab_width
setting.The text was updated successfully, but these errors were encountered: