aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/db.rs')
-rw-r--r--crates/ra_hir_def/src/db.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/db.rs b/crates/ra_hir_def/src/db.rs
index c55fd4111..da273eb11 100644
--- a/crates/ra_hir_def/src/db.rs
+++ b/crates/ra_hir_def/src/db.rs
@@ -3,6 +3,7 @@ use std::sync::Arc;
3 3
4use hir_expand::{db::AstDatabase, HirFileId}; 4use hir_expand::{db::AstDatabase, HirFileId};
5use ra_db::{salsa, CrateId, SourceDatabase}; 5use ra_db::{salsa, CrateId, SourceDatabase};
6use ra_prof::profile;
6use ra_syntax::SmolStr; 7use ra_syntax::SmolStr;
7 8
8use crate::{ 9use crate::{
@@ -46,9 +47,12 @@ pub trait DefDatabase: InternDatabase + AstDatabase {
46 #[salsa::invoke(RawItems::raw_items_query)] 47 #[salsa::invoke(RawItems::raw_items_query)]
47 fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>; 48 fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>;
48 49
49 #[salsa::invoke(CrateDefMap::crate_def_map_query)] 50 #[salsa::transparent]
50 fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>; 51 fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>;
51 52
53 #[salsa::invoke(CrateDefMap::compute_crate_def_map_query)]
54 fn compute_crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>;
55
52 #[salsa::invoke(StructData::struct_data_query)] 56 #[salsa::invoke(StructData::struct_data_query)]
53 fn struct_data(&self, id: StructId) -> Arc<StructData>; 57 fn struct_data(&self, id: StructId) -> Arc<StructData>;
54 #[salsa::invoke(StructData::union_data_query)] 58 #[salsa::invoke(StructData::union_data_query)]
@@ -104,3 +108,8 @@ pub trait DefDatabase: InternDatabase + AstDatabase {
104 #[salsa::invoke(Documentation::documentation_query)] 108 #[salsa::invoke(Documentation::documentation_query)]
105 fn documentation(&self, def: AttrDefId) -> Option<Documentation>; 109 fn documentation(&self, def: AttrDefId) -> Option<Documentation>;
106} 110}
111
112fn crate_def_map(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> {
113 let _p = profile("crate_def_map");
114 db.compute_crate_def_map(krate)
115}