diff options
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index 22bd49723..82596c665 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs | |||
@@ -10,7 +10,7 @@ use ra_prof::profile; | |||
10 | use ra_syntax::{ | 10 | use ra_syntax::{ |
11 | algo, | 11 | algo, |
12 | ast::{self, make, AstNode}, | 12 | ast::{self, make, AstNode}, |
13 | Location, SyntaxNode, TextRange, T, | 13 | SyntaxNode, TextRange, T, |
14 | }; | 14 | }; |
15 | use ra_text_edit::{TextEdit, TextEditBuilder}; | 15 | use ra_text_edit::{TextEdit, TextEditBuilder}; |
16 | 16 | ||
@@ -29,7 +29,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic> | |||
29 | let mut res = Vec::new(); | 29 | let mut res = Vec::new(); |
30 | 30 | ||
31 | res.extend(parse.errors().iter().map(|err| Diagnostic { | 31 | res.extend(parse.errors().iter().map(|err| Diagnostic { |
32 | range: location_to_range(err.location()), | 32 | range: err.range(), |
33 | message: format!("Syntax Error: {}", err), | 33 | message: format!("Syntax Error: {}", err), |
34 | severity: Severity::Error, | 34 | severity: Severity::Error, |
35 | fix: None, | 35 | fix: None, |
@@ -116,12 +116,6 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic> | |||
116 | drop(sink); | 116 | drop(sink); |
117 | res.into_inner() | 117 | res.into_inner() |
118 | } | 118 | } |
119 | fn location_to_range(location: Location) -> TextRange { | ||
120 | match location { | ||
121 | Location::Offset(offset) => TextRange::offset_len(offset, 1.into()), | ||
122 | Location::Range(range) => range, | ||
123 | } | ||
124 | } | ||
125 | 119 | ||
126 | fn check_unnecessary_braces_in_use_statement( | 120 | fn check_unnecessary_braces_in_use_statement( |
127 | acc: &mut Vec<Diagnostic>, | 121 | acc: &mut Vec<Diagnostic>, |