aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/db.rs2
-rw-r--r--crates/ra_hir_def/src/find_path.rs6
2 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs
index 498a4c917..2f71511ba 100644
--- a/crates/ra_hir_def/src/db.rs
+++ b/crates/ra_hir_def/src/db.rs
@@ -112,7 +112,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
112 #[salsa::invoke(Documentation::documentation_query)] 112 #[salsa::invoke(Documentation::documentation_query)]
113 fn documentation(&self, def: AttrDefId) -> Option<Documentation>; 113 fn documentation(&self, def: AttrDefId) -> Option<Documentation>;
114 114
115 #[salsa::invoke(find_path::importable_locations_in_crate)] 115 #[salsa::invoke(find_path::importable_locations_of_query)]
116 fn importable_locations_of( 116 fn importable_locations_of(
117 &self, 117 &self,
118 item: ItemInNs, 118 item: ItemInNs,
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs
index 15bc04c1a..2eb12ec8f 100644
--- a/crates/ra_hir_def/src/find_path.rs
+++ b/crates/ra_hir_def/src/find_path.rs
@@ -3,6 +3,7 @@
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use hir_expand::name::{known, AsName, Name}; 5use hir_expand::name::{known, AsName, Name};
6use ra_prof::profile;
6use test_utils::tested_by; 7use test_utils::tested_by;
7 8
8use crate::{ 9use crate::{
@@ -18,7 +19,7 @@ use crate::{
18/// Find a path that can be used to refer to a certain item. This can depend on 19/// 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/// *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> { 21pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> {
21 let _p = ra_prof::profile("find_path"); 22 let _p = profile("find_path");
22 find_path_inner(db, item, from, MAX_PATH_LEN) 23 find_path_inner(db, item, from, MAX_PATH_LEN)
23} 24}
24 25
@@ -213,11 +214,12 @@ fn find_importable_locations(
213/// 214///
214/// Note that the crate doesn't need to be the one in which the item is defined; 215/// Note that the crate doesn't need to be the one in which the item is defined;
215/// it might be re-exported in other crates. 216/// it might be re-exported in other crates.
216pub(crate) fn importable_locations_in_crate( 217pub(crate) fn importable_locations_of_query(
217 db: &dyn DefDatabase, 218 db: &dyn DefDatabase,
218 item: ItemInNs, 219 item: ItemInNs,
219 krate: CrateId, 220 krate: CrateId,
220) -> Arc<[(ModuleId, Name, Visibility)]> { 221) -> Arc<[(ModuleId, Name, Visibility)]> {
222 let _p = profile("importable_locations_of_query");
221 let def_map = db.crate_def_map(krate); 223 let def_map = db.crate_def_map(krate);
222 let mut result = Vec::new(); 224 let mut result = Vec::new();
223 for (local_id, data) in def_map.modules.iter() { 225 for (local_id, data) in def_map.modules.iter() {