diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 5 | ||||
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 6 | ||||
-rw-r--r-- | crates/ra_analysis/src/mock_analysis.rs | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 40996bfd7..a547c5a20 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 | ||
6 | use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit}; | 6 | use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit, Severity}; |
7 | use ra_syntax::{ | 7 | use ra_syntax::{ |
8 | ast::{self, ArgListOwner, Expr, NameOwner, FnDef}, | 8 | ast::{self, ArgListOwner, Expr, NameOwner, FnDef}, |
9 | algo::find_covering_node, | 9 | algo::find_covering_node, |
@@ -365,6 +365,7 @@ impl AnalysisImpl { | |||
365 | .map(|d| Diagnostic { | 365 | .map(|d| Diagnostic { |
366 | range: d.range, | 366 | range: d.range, |
367 | message: d.msg, | 367 | message: d.msg, |
368 | severity: d.severity, | ||
368 | fix: None, | 369 | fix: None, |
369 | }) | 370 | }) |
370 | .collect::<Vec<_>>(); | 371 | .collect::<Vec<_>>(); |
@@ -386,6 +387,7 @@ impl AnalysisImpl { | |||
386 | Diagnostic { | 387 | Diagnostic { |
387 | range: name_node.range(), | 388 | range: name_node.range(), |
388 | message: "unresolved module".to_string(), | 389 | message: "unresolved module".to_string(), |
390 | severity: Severity::Error, | ||
389 | fix: Some(fix), | 391 | fix: Some(fix), |
390 | } | 392 | } |
391 | } | 393 | } |
@@ -408,6 +410,7 @@ impl AnalysisImpl { | |||
408 | Diagnostic { | 410 | Diagnostic { |
409 | range: name_node.range(), | 411 | range: name_node.range(), |
410 | message: "can't declare module at this location".to_string(), | 412 | message: "can't declare module at this location".to_string(), |
413 | severity: Severity::Error, | ||
411 | fix: Some(fix), | 414 | fix: Some(fix), |
412 | } | 415 | } |
413 | } | 416 | } |
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 830898140..a029f66b4 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -29,11 +29,10 @@ use crate::{ | |||
29 | symbol_index::SymbolIndex, | 29 | symbol_index::SymbolIndex, |
30 | }; | 30 | }; |
31 | 31 | ||
32 | pub use crate::{ | 32 | pub use crate::completion::{CompletionItem, CompletionItemKind, InsertText}; |
33 | completion::{CompletionItem, CompletionItemKind, InsertText}, | ||
34 | }; | ||
35 | pub use ra_editor::{ | 33 | pub use ra_editor::{ |
36 | FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode, | 34 | FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode, |
35 | Severity | ||
37 | }; | 36 | }; |
38 | pub use hir::FnSignatureInfo; | 37 | pub use hir::FnSignatureInfo; |
39 | 38 | ||
@@ -198,6 +197,7 @@ pub struct Diagnostic { | |||
198 | pub message: String, | 197 | pub message: String, |
199 | pub range: TextRange, | 198 | pub range: TextRange, |
200 | pub fix: Option<SourceChange>, | 199 | pub fix: Option<SourceChange>, |
200 | pub severity: Severity, | ||
201 | } | 201 | } |
202 | 202 | ||
203 | #[derive(Debug)] | 203 | #[derive(Debug)] |
diff --git a/crates/ra_analysis/src/mock_analysis.rs b/crates/ra_analysis/src/mock_analysis.rs index 7cbdfb953..5ce2aa2b4 100644 --- a/crates/ra_analysis/src/mock_analysis.rs +++ b/crates/ra_analysis/src/mock_analysis.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use relative_path::{RelativePathBuf}; | 3 | use relative_path::RelativePathBuf; |
4 | use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; | 4 | use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; |
5 | use ra_db::mock::FileMap; | 5 | use ra_db::mock::FileMap; |
6 | 6 | ||