diff --git a/assets/settings/default.json b/assets/settings/default.json index dd9098e0c0..20819529ff 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -569,7 +569,8 @@ // "Neighbour" "activate_on_close": "history", /// Which files containing diagnostic errors/warnings to mark in the tabs. - /// This setting can take the following three values: + /// Diagnostics are only shown when file icons are also active. + /// This setting only works when can take the following three values: /// /// 1. Do not mark any files: /// "off" @@ -577,7 +578,7 @@ /// "errors" /// 3. Mark files with errors and warnings: /// "all" - "show_diagnostics": "all" + "show_diagnostics": "off" }, // Settings related to preview tabs. "preview_tabs": { diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 97c27b52a1..7b9478a9a7 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -64,9 +64,9 @@ pub enum ClosePosition { #[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ShowDiagnostics { + #[default] Off, Errors, - #[default] All, } @@ -99,7 +99,7 @@ pub struct ItemSettingsContent { /// Which files containing diagnostic errors/warnings to mark in the tabs. /// This setting can take the following three values: /// - /// Default: all + /// Default: off show_diagnostics: Option, /// Whether to always show the close button on tabs. /// diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index d213ab630b..a4ca58c11c 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2002,12 +2002,8 @@ impl Pane { let icon = if decorated_icon.is_none() { match item_diagnostic { - Some(&DiagnosticSeverity::ERROR) => { - Some(Icon::new(IconName::X).color(Color::Error)) - } - Some(&DiagnosticSeverity::WARNING) => { - Some(Icon::new(IconName::Triangle).color(Color::Warning)) - } + Some(&DiagnosticSeverity::ERROR) => None, + Some(&DiagnosticSeverity::WARNING) => None, _ => item.tab_icon(cx).map(|icon| icon.color(Color::Muted)), } .map(|icon| icon.size(IconSize::Small)) @@ -2144,13 +2140,17 @@ impl Pane { .child( h_flex() .gap_1() - .child(if let Some(decorated_icon) = decorated_icon { - div().child(decorated_icon.into_any_element()) - } else if let Some(icon) = icon { - div().mt(px(2.5)).child(icon.into_any_element()) - } else { - div() - }) + .items_center() + .children( + std::iter::once(if let Some(decorated_icon) = decorated_icon { + Some(div().child(decorated_icon.into_any_element())) + } else if let Some(icon) = icon { + Some(div().child(icon.into_any_element())) + } else { + None + }) + .flatten(), + ) .child(label), );