aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/display
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/display')
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index 02f55e5ba..f8a466304 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -279,13 +279,17 @@ impl ToNav for hir::Module {
279impl ToNav for hir::ImplDef { 279impl ToNav for hir::ImplDef {
280 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 280 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
281 let src = self.source(db); 281 let src = self.source(db);
282 let frange = if let Some(item) = self.is_builtin_derive(db) { 282 let derive_attr = self.is_builtin_derive(db);
283 let frange = if let Some(item) = &derive_attr {
283 original_range(db, item.syntax()) 284 original_range(db, item.syntax())
284 } else { 285 } else {
285 original_range(db, src.as_ref().map(|it| it.syntax())) 286 original_range(db, src.as_ref().map(|it| it.syntax()))
286 }; 287 };
287 let focus_range = 288 let focus_range = if derive_attr.is_some() {
288 src.value.target_type().map(|ty| original_range(db, src.with_value(ty.syntax())).range); 289 None
290 } else {
291 src.value.target_type().map(|ty| original_range(db, src.with_value(ty.syntax())).range)
292 };
289 293
290 NavigationTarget::from_syntax( 294 NavigationTarget::from_syntax(
291 frange.file_id, 295 frange.file_id,