From a61f2445cba2a48bb7ea6c8477e3198b297f3c67 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 27 Jul 2020 22:30:55 +0300 Subject: Less stubs --- crates/ra_ide/src/diagnostics.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide') 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( }) }) .on::(|d| { - let range = sema.diagnostics_range(d).range; // Note that although we could add a diagnostics to // fill the missing tuple field, e.g : // `struct A(usize);` @@ -95,15 +94,12 @@ pub(crate) fn diagnostics( }; Some(( Fix::new("Fill struct fields", SourceFileEdit { file_id, edit }.into()), - range, + sema.diagnostics_range(d).range, )) }; res.borrow_mut().push(Diagnostic { - range: d - .list_parent_ast(db) - .map(|path| path.syntax().text_range()) - .unwrap_or(range), + range: d.highlighting_source().file_syntax(db).text_range(), message: d.message(), severity: Severity::Error, fix, -- cgit v1.2.3