Qualify some paths in 'add missing impl members'

This commit is contained in:
Florian Diebold 2019-12-31 16:17:08 +01:00
parent 460fa71c55
commit 4d75430e91
6 changed files with 128 additions and 3 deletions

View file

@ -227,6 +227,19 @@ impl Module {
pub(crate) fn with_module_id(self, module_id: LocalModuleId) -> Module {
Module::new(self.krate(), module_id)
}
pub fn find_path(
self,
db: &impl DefDatabase,
item: ModuleDef,
) -> Option<hir_def::path::ModPath> {
// FIXME expose namespace choice
hir_def::find_path::find_path(
db,
hir_def::item_scope::ItemInNs::Types(item.into()),
self.into(),
)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]