diff options
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/db.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres.rs | 9 |
2 files changed, 8 insertions, 13 deletions
diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs index 2338b2cbe..dcd377aae 100644 --- a/crates/ra_hir_def/src/db.rs +++ b/crates/ra_hir_def/src/db.rs | |||
@@ -47,11 +47,11 @@ pub trait DefDatabase: InternDatabase + AstDatabase { | |||
47 | #[salsa::invoke(RawItems::raw_items_query)] | 47 | #[salsa::invoke(RawItems::raw_items_query)] |
48 | fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>; | 48 | fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>; |
49 | 49 | ||
50 | #[salsa::transparent] | 50 | #[salsa::invoke(crate_def_map_wait)] |
51 | fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>; | 51 | fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>; |
52 | 52 | ||
53 | #[salsa::invoke(CrateDefMap::compute_crate_def_map_query)] | 53 | #[salsa::invoke(CrateDefMap::crate_def_map_query)] |
54 | fn compute_crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>; | 54 | fn crate_def_map_query(&self, krate: CrateId) -> Arc<CrateDefMap>; |
55 | 55 | ||
56 | #[salsa::invoke(StructData::struct_data_query)] | 56 | #[salsa::invoke(StructData::struct_data_query)] |
57 | fn struct_data(&self, id: StructId) -> Arc<StructData>; | 57 | fn struct_data(&self, id: StructId) -> Arc<StructData>; |
@@ -109,7 +109,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase { | |||
109 | fn documentation(&self, def: AttrDefId) -> Option<Documentation>; | 109 | fn documentation(&self, def: AttrDefId) -> Option<Documentation>; |
110 | } | 110 | } |
111 | 111 | ||
112 | fn crate_def_map(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> { | 112 | fn crate_def_map_wait(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> { |
113 | let _p = profile("wait_crate_def_map"); | 113 | let _p = profile("crate_def_map:wait"); |
114 | db.compute_crate_def_map(krate) | 114 | db.crate_def_map_query(krate) |
115 | } | 115 | } |
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs index 166d1c421..628c44c99 100644 --- a/crates/ra_hir_def/src/nameres.rs +++ b/crates/ra_hir_def/src/nameres.rs | |||
@@ -176,13 +176,8 @@ pub struct ModuleData { | |||
176 | } | 176 | } |
177 | 177 | ||
178 | impl CrateDefMap { | 178 | impl CrateDefMap { |
179 | pub(crate) fn compute_crate_def_map_query( | 179 | pub(crate) fn crate_def_map_query(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> { |
180 | // Note that this doesn't have `+ AstDatabase`! | 180 | let _p = profile("crate_def_map_query"); |
181 | // This gurantess that `CrateDefMap` is stable across reparses. | ||
182 | db: &impl DefDatabase, | ||
183 | krate: CrateId, | ||
184 | ) -> Arc<CrateDefMap> { | ||
185 | let _p = profile("crate_def_map"); | ||
186 | let def_map = { | 181 | let def_map = { |
187 | let crate_graph = db.crate_graph(); | 182 | let crate_graph = db.crate_graph(); |
188 | let edition = crate_graph.edition(krate); | 183 | let edition = crate_graph.edition(krate); |