diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index aee7e75118..15bc04c1ac 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs @@ -13,6 +13,15 @@ use crate::{ CrateId, ModuleDefId, ModuleId, }; +// FIXME: handle local items + +/// Find a path that can be used to refer to a certain item. This can depend on +/// *from where* you're referring to the item, hence the `from` parameter. +pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option { + let _p = ra_prof::profile("find_path"); + find_path_inner(db, item, from, MAX_PATH_LEN) +} + const MAX_PATH_LEN: usize = 15; impl ModPath { @@ -39,15 +48,6 @@ impl ModPath { } } -// FIXME: handle local items - -/// Find a path that can be used to refer to a certain item. This can depend on -/// *from where* you're referring to the item, hence the `from` parameter. -pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option { - let _p = ra_prof::profile("find_path"); - find_path_inner(db, item, from, MAX_PATH_LEN) -} - fn find_path_inner( db: &dyn DefDatabase, item: ItemInNs,