diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/diagnostics.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index 7ae4bda0b..e847df6ea 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs | |||
@@ -69,7 +69,6 @@ pub(crate) fn diagnostics( | |||
69 | }) | 69 | }) |
70 | }) | 70 | }) |
71 | .on::<hir::diagnostics::MissingFields, _>(|d| { | 71 | .on::<hir::diagnostics::MissingFields, _>(|d| { |
72 | let range = sema.diagnostics_range(d).range; | ||
73 | // Note that although we could add a diagnostics to | 72 | // Note that although we could add a diagnostics to |
74 | // fill the missing tuple field, e.g : | 73 | // fill the missing tuple field, e.g : |
75 | // `struct A(usize);` | 74 | // `struct A(usize);` |
@@ -95,15 +94,12 @@ pub(crate) fn diagnostics( | |||
95 | }; | 94 | }; |
96 | Some(( | 95 | Some(( |
97 | Fix::new("Fill struct fields", SourceFileEdit { file_id, edit }.into()), | 96 | Fix::new("Fill struct fields", SourceFileEdit { file_id, edit }.into()), |
98 | range, | 97 | sema.diagnostics_range(d).range, |
99 | )) | 98 | )) |
100 | }; | 99 | }; |
101 | 100 | ||
102 | res.borrow_mut().push(Diagnostic { | 101 | res.borrow_mut().push(Diagnostic { |
103 | range: d | 102 | range: d.highlighting_source().file_syntax(db).text_range(), |
104 | .list_parent_ast(db) | ||
105 | .map(|path| path.syntax().text_range()) | ||
106 | .unwrap_or(range), | ||
107 | message: d.message(), | 103 | message: d.message(), |
108 | severity: Severity::Error, | 104 | severity: Severity::Error, |
109 | fix, | 105 | fix, |