From 346638c8098fefd0b6fa3cf81fbdf22ebfaab9be Mon Sep 17 00:00:00 2001 From: gfreezy Date: Mon, 24 Dec 2018 00:39:33 +0800 Subject: add serverity to vscode diagnostics --- crates/ra_analysis/src/imp.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/imp.rs') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index b01382808..e054227a9 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -3,7 +3,7 @@ use std::{ sync::Arc, }; -use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit}; +use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit, Severity}; use ra_syntax::{ ast::{self, ArgListOwner, Expr, NameOwner}, AstNode, SourceFileNode, @@ -364,6 +364,7 @@ impl AnalysisImpl { .map(|d| Diagnostic { range: d.range, message: d.msg, + severity: d.severity, fix: None, }) .collect::>(); @@ -385,6 +386,7 @@ impl AnalysisImpl { Diagnostic { range: name_node.range(), message: "unresolved module".to_string(), + severity: Some(Severity::Error), fix: Some(fix), } } @@ -407,6 +409,7 @@ impl AnalysisImpl { Diagnostic { range: name_node.range(), message: "can't declare module at this location".to_string(), + severity: Some(Severity::Error), fix: Some(fix), } } -- cgit v1.2.3 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_analysis/src/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/imp.rs') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index e054227a9..e8d6acc17 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::>(); -- cgit v1.2.3 From 29798c763cc121f7d610544deb940d70e4e33649 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Mon, 24 Dec 2018 23:00:18 +0800 Subject: remove option from Diagnostic --- crates/ra_analysis/src/imp.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_analysis/src/imp.rs') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index e8d6acc17..00cdf7eff 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: Some(d.severity), + severity: d.severity, fix: None, }) .collect::>(); @@ -386,7 +386,7 @@ impl AnalysisImpl { Diagnostic { range: name_node.range(), message: "unresolved module".to_string(), - severity: Some(Severity::Error), + severity: Severity::Error, fix: Some(fix), } } @@ -409,7 +409,7 @@ impl AnalysisImpl { Diagnostic { range: name_node.range(), message: "can't declare module at this location".to_string(), - severity: Some(Severity::Error), + severity: Severity::Error, fix: Some(fix), } } -- cgit v1.2.3