From 70df097c89ee45e4e0709c21b8aeee2e84e09fc4 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Mon, 24 Dec 2018 22:48:46 +0800 Subject: keep severity to Error & WeakWarning --- crates/ra_editor/src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'crates/ra_editor/src') diff --git a/crates/ra_editor/src/lib.rs b/crates/ra_editor/src/lib.rs index 399bb8fe8..75e4a5f32 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