aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-19 15:46:33 +0100
committerAleksey Kladov <[email protected]>2020-05-19 15:46:33 +0100
commit01bd1e1296d31dbb102d198e9fd82e1e36f1193b (patch)
treee3e817359633020d8a3f58a816665c425dd8dc18
parent908da9ac1b04a0eb27552ec9ca68a5f88c4f42c7 (diff)
Move public API to the top
-rw-r--r--crates/ra_hir_def/src/find_path.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs
index aee7e7511..15bc04c1a 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::{
13 CrateId, ModuleDefId, ModuleId, 13 CrateId, ModuleDefId, ModuleId,
14}; 14};
15 15
16// FIXME: handle local items
17
18/// Find a path that can be used to refer to a certain item. This can depend on
19/// *from where* you're referring to the item, hence the `from` parameter.
20pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> {
21 let _p = ra_prof::profile("find_path");
22 find_path_inner(db, item, from, MAX_PATH_LEN)
23}
24
16const MAX_PATH_LEN: usize = 15; 25const MAX_PATH_LEN: usize = 15;
17 26
18impl ModPath { 27impl ModPath {
@@ -39,15 +48,6 @@ impl ModPath {
39 } 48 }
40} 49}
41 50
42// FIXME: handle local items
43
44/// Find a path that can be used to refer to a certain item. This can depend on
45/// *from where* you're referring to the item, hence the `from` parameter.
46pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> {
47 let _p = ra_prof::profile("find_path");
48 find_path_inner(db, item, from, MAX_PATH_LEN)
49}
50
51fn find_path_inner( 51fn find_path_inner(
52 db: &dyn DefDatabase, 52 db: &dyn DefDatabase,
53 item: ItemInNs, 53 item: ItemInNs,