Go to Implementation for structs and enums

This commit is contained in:
Jeremy Kolb 2019-01-28 09:26:32 -05:00
parent 48d2acb297
commit 3c17643b30
14 changed files with 279 additions and 18 deletions

View file

@ -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();