From 9abf0d9659d0d48036c4172e29fe33770134dd61 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 7 Mar 2020 00:11:52 +0100 Subject: Normalize waiting queries names --- crates/ra_hir_def/src/db.rs | 12 ++++++------ crates/ra_hir_def/src/nameres.rs | 9 ++------- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'crates/ra_hir_def') 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 { #[salsa::invoke(RawItems::raw_items_query)] fn raw_items(&self, file_id: HirFileId) -> Arc; - #[salsa::transparent] + #[salsa::invoke(crate_def_map_wait)] fn crate_def_map(&self, krate: CrateId) -> Arc; - #[salsa::invoke(CrateDefMap::compute_crate_def_map_query)] - fn compute_crate_def_map(&self, krate: CrateId) -> Arc; + #[salsa::invoke(CrateDefMap::crate_def_map_query)] + fn crate_def_map_query(&self, krate: CrateId) -> Arc; #[salsa::invoke(StructData::struct_data_query)] fn struct_data(&self, id: StructId) -> Arc; @@ -109,7 +109,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase { fn documentation(&self, def: AttrDefId) -> Option; } -fn crate_def_map(db: &impl DefDatabase, krate: CrateId) -> Arc { - let _p = profile("wait_crate_def_map"); - db.compute_crate_def_map(krate) +fn crate_def_map_wait(db: &impl DefDatabase, krate: CrateId) -> Arc { + let _p = profile("crate_def_map:wait"); + db.crate_def_map_query(krate) } 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 { } impl CrateDefMap { - pub(crate) fn compute_crate_def_map_query( - // Note that this doesn't have `+ AstDatabase`! - // This gurantess that `CrateDefMap` is stable across reparses. - db: &impl DefDatabase, - krate: CrateId, - ) -> Arc { - let _p = profile("crate_def_map"); + pub(crate) fn crate_def_map_query(db: &impl DefDatabase, krate: CrateId) -> Arc { + let _p = profile("crate_def_map_query"); let def_map = { let crate_graph = db.crate_graph(); let edition = crate_graph.edition(krate); -- cgit v1.2.3