mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Added local macro goto
This commit is contained in:
parent
12629d5e4f
commit
8198e13c26
9 changed files with 97 additions and 6 deletions
|
@ -213,6 +213,15 @@ impl NavigationTarget {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_macro_def(
|
||||
db: &RootDatabase,
|
||||
macro_call: hir::MacroByExampleDef,
|
||||
) -> NavigationTarget {
|
||||
let (file_id, node) = macro_call.source(db);
|
||||
log::debug!("nav target {}", node.syntax().debug_dump());
|
||||
NavigationTarget::from_named(file_id.original_file(db), &*node)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn assert_match(&self, expected: &str) {
|
||||
let actual = self.debug_render();
|
||||
|
@ -289,6 +298,7 @@ impl NavigationTarget {
|
|||
.visit(doc_comments::<ast::StaticDef>)
|
||||
.visit(doc_comments::<ast::NamedFieldDef>)
|
||||
.visit(doc_comments::<ast::EnumVariant>)
|
||||
.visit(doc_comments::<ast::MacroCall>)
|
||||
.accept(&node)?
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue