diff options
Diffstat (limited to 'crates/ra_ide_api/src/display/navigation_target.rs')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 84645287d..765cf883b 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -213,6 +213,15 @@ impl NavigationTarget { | |||
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | pub(crate) fn from_macro_def( | ||
217 | db: &RootDatabase, | ||
218 | macro_call: hir::MacroByExampleDef, | ||
219 | ) -> NavigationTarget { | ||
220 | let (file_id, node) = macro_call.source(db); | ||
221 | log::debug!("nav target {}", node.syntax().debug_dump()); | ||
222 | NavigationTarget::from_named(file_id.original_file(db), &*node) | ||
223 | } | ||
224 | |||
216 | #[cfg(test)] | 225 | #[cfg(test)] |
217 | pub(crate) fn assert_match(&self, expected: &str) { | 226 | pub(crate) fn assert_match(&self, expected: &str) { |
218 | let actual = self.debug_render(); | 227 | let actual = self.debug_render(); |
@@ -289,6 +298,7 @@ impl NavigationTarget { | |||
289 | .visit(doc_comments::<ast::StaticDef>) | 298 | .visit(doc_comments::<ast::StaticDef>) |
290 | .visit(doc_comments::<ast::NamedFieldDef>) | 299 | .visit(doc_comments::<ast::NamedFieldDef>) |
291 | .visit(doc_comments::<ast::EnumVariant>) | 300 | .visit(doc_comments::<ast::EnumVariant>) |
301 | .visit(doc_comments::<ast::MacroCall>) | ||
292 | .accept(&node)? | 302 | .accept(&node)? |
293 | } | 303 | } |
294 | 304 | ||