diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index e054227a98b8..e8d6acc177e1 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -364,7 +364,7 @@ impl AnalysisImpl { .map(|d| Diagnostic { range: d.range, message: d.msg, - severity: d.severity, + severity: Some(d.severity), fix: None, }) .collect::>(); diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs index 399bb8fe84f7..75e4a5f3249b 100644 --- a/crates/ra_editor/src/lib.rs +++ b/crates/ra_editor/src/lib.rs @@ -34,16 +34,14 @@ pub struct HighlightedRange { #[derive(Debug, Copy, Clone)] pub enum Severity { Error, - Warning, - Information, - Hint, + WeakWarning, } #[derive(Debug)] pub struct Diagnostic { pub range: TextRange, pub msg: String, - pub severity: Option, + pub severity: Severity, } #[derive(Debug)] @@ -112,7 +110,7 @@ pub fn diagnostics(file: &SourceFileNode) -> Vec { .map(|err| Diagnostic { range: location_to_range(err.location()), msg: format!("Syntax Error: {}", err), - severity: Some(Severity::Error), + severity: Severity::Error, }) .collect(); @@ -130,7 +128,7 @@ fn check_unnecessary_braces_in_use_statement(file: &SourceFileNode) -> Vec