Show a warning at the end of the diagnostic list if there are any fatal warnings (#17855)

This commit is contained in:
Micha Reiser 2025-05-06 09:14:21 +02:00 committed by GitHub
parent d410d12bc5
commit 6f821ac846
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -674,6 +674,10 @@ impl Severity {
Severity::Fatal => AnnotateLevel::Error,
}
}
pub const fn is_fatal(self) -> bool {
matches!(self, Severity::Fatal)
}
}
/// Configuration for rendering diagnostics.

View file

@ -306,6 +306,10 @@ impl MainLoop {
if diagnostics_count > 1 { "s" } else { "" }
)?;
if max_severity.is_fatal() {
tracing::warn!("A fatal occurred while checking some files. Not all project files were analyzed. See the diagnostics list above for details.");
}
if self.watcher.is_none() {
return Ok(match max_severity {
Severity::Info => ExitStatus::Success,