aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/find_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/find_path.rs')
-rw-r--r--crates/ra_hir_def/src/find_path.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs
index 68d3cde08..4db798473 100644
--- a/crates/ra_hir_def/src/find_path.rs
+++ b/crates/ra_hir_def/src/find_path.rs
@@ -20,7 +20,7 @@ use crate::{
20/// *from where* you're referring to the item, hence the `from` parameter. 20/// *from where* you're referring to the item, hence the `from` parameter.
21pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> { 21pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> {
22 let _p = profile("find_path"); 22 let _p = profile("find_path");
23 find_path_inner(db, item, from, MAX_PATH_LEN) 23 db.find_path_inner(item, from, MAX_PATH_LEN)
24} 24}
25 25
26const MAX_PATH_LEN: usize = 15; 26const MAX_PATH_LEN: usize = 15;
@@ -49,7 +49,7 @@ impl ModPath {
49 } 49 }
50} 50}
51 51
52fn find_path_inner( 52pub(crate) fn find_path_inner_query(
53 db: &dyn DefDatabase, 53 db: &dyn DefDatabase,
54 item: ItemInNs, 54 item: ItemInNs,
55 from: ModuleId, 55 from: ModuleId,
@@ -140,8 +140,7 @@ fn find_path_inner(
140 let mut best_path = None; 140 let mut best_path = None;
141 let mut best_path_len = max_len; 141 let mut best_path_len = max_len;
142 for (module_id, name) in importable_locations { 142 for (module_id, name) in importable_locations {
143 let mut path = match find_path_inner( 143 let mut path = match db.find_path_inner(
144 db,
145 ItemInNs::Types(ModuleDefId::ModuleId(module_id)), 144 ItemInNs::Types(ModuleDefId::ModuleId(module_id)),
146 from, 145 from,
147 best_path_len - 1, 146 best_path_len - 1,