Change default Prettier's useTabs settings based on Zed settings (#11958)

Part of https://github.com/zed-industries/zed/issues/7656

When a project is formatted by Prettier that Zed installs, make it
respect Zed's `hard_tabs` settings by passing the value into Prettier
config as `useTabs`.


https://github.com/zed-industries/zed/assets/2690773/80345cdd-d4f8-40b2-ab56-dba6b9646c70

Release Notes:

- Fixed default Prettier not respecting Zed's `hard_tabs` settings
This commit is contained in:
Kirill Bulatov 2024-05-17 11:05:46 +03:00 committed by GitHub
parent 4ca6e0e387
commit 5ad8e721db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -292,6 +292,12 @@ impl Prettier {
)),
);
}
if !options.contains_key("useTabs") {
options.insert(
"useTabs".to_string(),
serde_json::Value::Bool(language_settings.hard_tabs),
);
}
Some(options)
} else {
None