From f7d3a873050fb8360b663ca281a805de8cf7f30d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Jun 2019 22:31:22 +0300 Subject: collect impl source maps --- crates/ra_hir/src/db.rs | 3 --- crates/ra_hir/src/impl_block.rs | 9 +-------- crates/ra_ide_api/src/change.rs | 1 + 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index dcc881a36..e8b4f0ddc 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -92,9 +92,6 @@ pub trait DefDatabase: SourceDatabase { #[salsa::invoke(crate::impl_block::impls_in_module)] fn impls_in_module(&self, module: Module) -> Arc; - #[salsa::invoke(crate::impl_block::impls_in_module_source_map_query)] - fn impls_in_module_source_map(&self, module: Module) -> Arc; - #[salsa::invoke(crate::impl_block::impls_in_module_with_source_map_query)] fn impls_in_module_with_source_map( &self, diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 637f6ab83..072670444 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs @@ -59,7 +59,7 @@ impl ImplBlock { /// Returns the syntax of the impl block pub fn source(&self, db: &impl DefDatabase) -> (HirFileId, TreeArc) { - let source_map = db.impls_in_module_source_map(self.module); + let source_map = db.impls_in_module_with_source_map(self.module).1; let (file_id, source) = self.module.definition_source(db); (file_id, source_map.get(&source, self.impl_id)) } @@ -231,10 +231,3 @@ pub(crate) fn impls_in_module_with_source_map_query( pub(crate) fn impls_in_module(db: &impl DefDatabase, module: Module) -> Arc { db.impls_in_module_with_source_map(module).0 } - -pub(crate) fn impls_in_module_source_map_query( - db: &impl DefDatabase, - module: Module, -) -> Arc { - db.impls_in_module_with_source_map(module).1 -} diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 4196a3853..445a94aa8 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -230,6 +230,7 @@ impl RootDatabase { self.query(hir::db::AstIdMapQuery).sweep(sweep); self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); + self.query(hir::db::ImplsInModuleWithSourceMapQuery).sweep(sweep); self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); } } -- cgit v1.2.3