mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-29 12:00:19 +01:00
09503333af
Follow-up to #30565 This PR fixes the default settings values for the `DiagnosticsSettings`. The issue here was that due to the `#[derive(Default)]`, `button` would be false by default, which unintentionally hid the diagnostics button by default. The `#[serde(default = `default_true`)]` would only apply iff the diagnostics key was already present in the user's settings. Thus, if you have ```json { "diagnostics": {...} } ``` in your settings, the button would show (given it was not disabled). However, if the key was not present, the button was not shown: Due to the derived default for the entire struct, the value would be false. This PR fixes this by implementing the default instead and moving the `#[serde(default)]` up to the level of the struct. I also did the same for the inline diagnostics settings, which already had a default impl and thus only needed the serde default on the struct instead of on all the struct fields. Lastly, I simplified the title bar settings, since the serde attributes previously had no effect anyway (deserialization happened in the `TitlebarSettingsContent`, so these attributes had no effect) and we can remove the `TitlebarSettingsContent` as well as the attributes if we implement a proper default implementation instead. Release Notes: - Fixed the diagnostics status bar button being hidden by default.