diff options
Diffstat (limited to 'crates/ide/src/display/navigation_target.rs')
-rw-r--r-- | crates/ide/src/display/navigation_target.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index c086de163..364be260c 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -339,10 +339,14 @@ impl TryToNav for hir::Field { | |||
339 | impl TryToNav for hir::MacroDef { | 339 | impl TryToNav for hir::MacroDef { |
340 | fn try_to_nav(&self, db: &RootDatabase) -> Option<NavigationTarget> { | 340 | fn try_to_nav(&self, db: &RootDatabase) -> Option<NavigationTarget> { |
341 | let src = self.source(db)?; | 341 | let src = self.source(db)?; |
342 | log::debug!("nav target {:#?}", src.value.syntax()); | 342 | let name_owner: &dyn ast::NameOwner = match &src.value { |
343 | Either::Left(it) => it, | ||
344 | Either::Right(it) => it, | ||
345 | }; | ||
346 | log::debug!("nav target {:#?}", name_owner.syntax()); | ||
343 | let mut res = NavigationTarget::from_named( | 347 | let mut res = NavigationTarget::from_named( |
344 | db, | 348 | db, |
345 | src.as_ref().map(|it| it as &dyn ast::NameOwner), | 349 | src.as_ref().with_value(name_owner), |
346 | SymbolKind::Macro, | 350 | SymbolKind::Macro, |
347 | ); | 351 | ); |
348 | res.docs = self.docs(db); | 352 | res.docs = self.docs(db); |