Use Severity::Warning for miette warnings (#16146)

# Description


Changes miette warnings to use `Severity::Warning` instead of the
default `Severity::Error`. This shows them in a different color and with
a different icon:

<img width="650" height="266" alt="image"
src="https://github.com/user-attachments/assets/3ff0d3cf-ab1e-47f2-aff7-586ecea5a32a"
/>


# User-Facing Changes

* Warnings now look less like errors
This commit is contained in:
132ikl
2025-07-10 14:50:12 -04:00
committed by GitHub
parent 33a2b98f66
commit 8943fcf78d
2 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use thiserror::Error;
use super::ReportMode; use super::ReportMode;
#[derive(Clone, Debug, Error, Diagnostic, Serialize, Deserialize)] #[derive(Clone, Debug, Error, Diagnostic, Serialize, Deserialize)]
#[diagnostic(severity(Warning))]
pub enum ParseWarning { pub enum ParseWarning {
#[error("{dep_type} deprecated.")] #[error("{dep_type} deprecated.")]
#[diagnostic(code(nu::parser::deprecated))] #[diagnostic(code(nu::parser::deprecated))]

View File

@ -1220,7 +1220,7 @@ This is an internal Nushell error, please file an issue https://github.com/nushe
}, },
#[error("{deprecation_type} deprecated.")] #[error("{deprecation_type} deprecated.")]
#[diagnostic(code(nu::shell::deprecated))] #[diagnostic(code(nu::shell::deprecated), severity(Warning))]
DeprecationWarning { DeprecationWarning {
deprecation_type: &'static str, deprecation_type: &'static str,
suggestion: String, suggestion: String,