diff options
-rw-r--r-- | crates/ra_hir_def/src/find_path.rs | 18 |
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. | ||
20 | pub 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 | |||
16 | const MAX_PATH_LEN: usize = 15; | 25 | const MAX_PATH_LEN: usize = 15; |
17 | 26 | ||
18 | impl ModPath { | 27 | impl 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. | ||
46 | pub 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 | |||
51 | fn find_path_inner( | 51 | fn find_path_inner( |
52 | db: &dyn DefDatabase, | 52 | db: &dyn DefDatabase, |
53 | item: ItemInNs, | 53 | item: ItemInNs, |