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