aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-07-27 20:30:55 +0100
committerKirill Bulatov <[email protected]>2020-08-11 13:09:08 +0100
commita61f2445cba2a48bb7ea6c8477e3198b297f3c67 (patch)
treecce28de2e55620a94041fb481e914b16da5569d9 /crates/ra_ide
parent21e5224484b9214648826e1b15aa9150c79a407c (diff)
Less stubs
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/diagnostics.rs8
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,