From d7be1a437239770552199028259639e6dfa8a664 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 12 Jan 2020 18:08:53 +0800 Subject: Use attr location for builtin macro goto-imp --- crates/ra_ide/src/display/navigation_target.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index f2e45fa31..b2af3479c 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -251,7 +251,11 @@ impl ToNav for hir::Module { impl ToNav for hir::ImplBlock { fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { let src = self.source(db); - let frange = original_range(db, src.as_ref().map(|it| it.syntax())); + let frange = if let Some(item) = self.is_builtin_derive(db) { + original_range(db, item.syntax()) + } else { + original_range(db, src.as_ref().map(|it| it.syntax())) + }; NavigationTarget::from_syntax( frange.file_id, -- cgit v1.2.3