mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Go to Implementation for structs and enums
This commit is contained in:
parent
48d2acb297
commit
3c17643b30
14 changed files with 279 additions and 18 deletions
|
@ -147,6 +147,16 @@ impl NavigationTarget {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_impl_block(
|
||||
db: &RootDatabase,
|
||||
module: hir::Module,
|
||||
impl_block: &hir::ImplBlock,
|
||||
) -> NavigationTarget {
|
||||
let (file_id, _) = module.definition_source(db);
|
||||
let node = module.impl_source(db, impl_block.id());
|
||||
NavigationTarget::from_syntax(file_id, "impl".into(), None, node.syntax())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn assert_match(&self, expected: &str) {
|
||||
let actual = self.debug_render();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue