aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/imp.rs5
-rw-r--r--crates/ra_analysis/src/lib.rs2
2 files changed, 6 insertions, 1 deletions
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::{
3 sync::Arc, 3 sync::Arc,
4}; 4};
5 5
6use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit}; 6use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit, Severity};
7use ra_syntax::{ 7use ra_syntax::{
8 ast::{self, ArgListOwner, Expr, NameOwner}, 8 ast::{self, ArgListOwner, Expr, NameOwner},
9 AstNode, SourceFileNode, 9 AstNode, SourceFileNode,
@@ -364,6 +364,7 @@ impl AnalysisImpl {
364 .map(|d| Diagnostic { 364 .map(|d| Diagnostic {
365 range: d.range, 365 range: d.range,
366 message: d.msg, 366 message: d.msg,
367 severity: d.severity,
367 fix: None, 368 fix: None,
368 }) 369 })
369 .collect::<Vec<_>>(); 370 .collect::<Vec<_>>();
@@ -385,6 +386,7 @@ impl AnalysisImpl {
385 Diagnostic { 386 Diagnostic {
386 range: name_node.range(), 387 range: name_node.range(),
387 message: "unresolved module".to_string(), 388 message: "unresolved module".to_string(),
389 severity: Some(Severity::Error),
388 fix: Some(fix), 390 fix: Some(fix),
389 } 391 }
390 } 392 }
@@ -407,6 +409,7 @@ impl AnalysisImpl {
407 Diagnostic { 409 Diagnostic {
408 range: name_node.range(), 410 range: name_node.range(),
409 message: "can't declare module at this location".to_string(), 411 message: "can't declare module at this location".to_string(),
412 severity: Some(Severity::Error),
410 fix: Some(fix), 413 fix: Some(fix),
411 } 414 }
412 } 415 }
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs
index 85df9c089..8ab6334a7 100644
--- a/crates/ra_analysis/src/lib.rs
+++ b/crates/ra_analysis/src/lib.rs
@@ -34,6 +34,7 @@ pub use crate::{
34}; 34};
35pub use ra_editor::{ 35pub use ra_editor::{
36 FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode, 36 FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode,
37 Severity
37}; 38};
38pub use hir::FnSignatureInfo; 39pub use hir::FnSignatureInfo;
39 40
@@ -198,6 +199,7 @@ pub struct Diagnostic {
198 pub message: String, 199 pub message: String,
199 pub range: TextRange, 200 pub range: TextRange,
200 pub fix: Option<SourceChange>, 201 pub fix: Option<SourceChange>,
202 pub severity: Option<Severity>,
201} 203}
202 204
203#[derive(Debug)] 205#[derive(Debug)]