Remove redundant Cargo diagnostics settings (#36795)

Removes `diagnostics.cargo.fetch_cargo_diagnostics` settings as those
are not needed for the flycheck diagnostics to run.
This setting disabled `checkOnSave` in rust-analyzer and allowed to
update diagnostics via flycheck in the project diagnostics editor with
the "refresh" button.

Instead, `"checkOnSave": false,` can be set manually as
https://zed.dev/docs/languages/rust#more-server-configuration example
shows and flycheck commands can be called manually from anywhere,
including the diagnostics panel, to refresh the diagnostics.

Release Notes:

- Removed redundant `diagnostics.cargo.fetch_cargo_diagnostics` settings
This commit is contained in:
Kirill Bulatov 2025-08-23 10:03:36 +03:00 committed by GitHub
parent ea42013746
commit 70575d1115
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 14 additions and 211 deletions

View file

@ -181,17 +181,6 @@ pub struct DiagnosticsSettings {
/// Settings for showing inline diagnostics.
pub inline: InlineDiagnosticsSettings,
/// Configuration, related to Rust language diagnostics.
pub cargo: Option<CargoDiagnosticsSettings>,
}
impl DiagnosticsSettings {
pub fn fetch_cargo_diagnostics(&self) -> bool {
self.cargo
.as_ref()
.is_some_and(|cargo_diagnostics| cargo_diagnostics.fetch_cargo_diagnostics)
}
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema)]
@ -258,7 +247,6 @@ impl Default for DiagnosticsSettings {
include_warnings: true,
lsp_pull_diagnostics: LspPullDiagnosticsSettings::default(),
inline: InlineDiagnosticsSettings::default(),
cargo: None,
}
}
}
@ -292,16 +280,6 @@ impl Default for GlobalLspSettings {
}
}
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
pub struct CargoDiagnosticsSettings {
/// When enabled, Zed disables rust-analyzer's check on save and starts to query
/// Cargo diagnostics separately.
///
/// Default: false
#[serde(default)]
pub fetch_cargo_diagnostics: bool,
}
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, JsonSchema,
)]