diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model_impl/module.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/db.rs | 14 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/lower.rs | 13 | ||||
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 2 |
6 files changed, 14 insertions, 21 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index e362cc05f..3ac146950 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -191,7 +191,7 @@ impl Module { | |||
191 | } | 191 | } |
192 | 192 | ||
193 | pub fn declarations(self, db: &impl HirDatabase) -> Vec<ModuleDef> { | 193 | pub fn declarations(self, db: &impl HirDatabase) -> Vec<ModuleDef> { |
194 | let (lowered_module, _) = db.lower_module(self); | 194 | let lowered_module = db.lower_module(self); |
195 | lowered_module | 195 | lowered_module |
196 | .declarations | 196 | .declarations |
197 | .values() | 197 | .values() |
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs index 2d3058afd..437f96942 100644 --- a/crates/ra_hir/src/code_model_impl/module.rs +++ b/crates/ra_hir/src/code_model_impl/module.rs | |||
@@ -47,7 +47,7 @@ impl Module { | |||
47 | db: &impl HirDatabase, | 47 | db: &impl HirDatabase, |
48 | import: ImportId, | 48 | import: ImportId, |
49 | ) -> TreeArc<ast::PathSegment> { | 49 | ) -> TreeArc<ast::PathSegment> { |
50 | let source_map = db.lower_module_source_map(*self); | 50 | let (_, source_map) = db.lower_module_with_source_map(*self); |
51 | let (_, source) = self.definition_source(db); | 51 | let (_, source) = self.definition_source(db); |
52 | source_map.get(&source, import) | 52 | source_map.get(&source, import) |
53 | } | 53 | } |
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index a669dc9b0..21d22aa7f 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs | |||
@@ -48,14 +48,14 @@ pub trait PersistentHirDatabase: SourceDatabase + AsRef<HirInterner> { | |||
48 | delc_id: Option<SourceFileItemId>, | 48 | delc_id: Option<SourceFileItemId>, |
49 | ) -> Arc<Vec<crate::module_tree::Submodule>>; | 49 | ) -> Arc<Vec<crate::module_tree::Submodule>>; |
50 | 50 | ||
51 | #[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_query)] | 51 | #[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_with_source_map_query)] |
52 | fn lower_module(&self, module: Module) -> (Arc<LoweredModule>, Arc<ImportSourceMap>); | 52 | fn lower_module_with_source_map( |
53 | 53 | &self, | |
54 | #[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_module_query)] | 54 | module: Module, |
55 | fn lower_module_module(&self, module: Module) -> Arc<LoweredModule>; | 55 | ) -> (Arc<LoweredModule>, Arc<ImportSourceMap>); |
56 | 56 | ||
57 | #[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_source_map_query)] | 57 | #[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_query)] |
58 | fn lower_module_source_map(&self, module: Module) -> Arc<ImportSourceMap>; | 58 | fn lower_module(&self, module: Module) -> Arc<LoweredModule>; |
59 | 59 | ||
60 | #[salsa::invoke(crate::nameres::ItemMap::item_map_query)] | 60 | #[salsa::invoke(crate::nameres::ItemMap::item_map_query)] |
61 | fn item_map(&self, krate: Crate) -> Arc<ItemMap>; | 61 | fn item_map(&self, krate: Crate) -> Arc<ItemMap>; |
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index ac390c5db..73919ee37 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -481,7 +481,7 @@ impl ItemMap { | |||
481 | let module_tree = db.module_tree(krate); | 481 | let module_tree = db.module_tree(krate); |
482 | let input = module_tree | 482 | let input = module_tree |
483 | .modules() | 483 | .modules() |
484 | .map(|module_id| (module_id, db.lower_module_module(Module { krate, module_id }))) | 484 | .map(|module_id| (module_id, db.lower_module(Module { krate, module_id }))) |
485 | .collect::<FxHashMap<_, _>>(); | 485 | .collect::<FxHashMap<_, _>>(); |
486 | 486 | ||
487 | let resolver = Resolver::new(db, &input, krate); | 487 | let resolver = Resolver::new(db, &input, krate); |
diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 2bc3eb60c..56262ad6d 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs | |||
@@ -60,21 +60,14 @@ impl ImportSourceMap { | |||
60 | } | 60 | } |
61 | 61 | ||
62 | impl LoweredModule { | 62 | impl LoweredModule { |
63 | pub(crate) fn lower_module_module_query( | 63 | pub(crate) fn lower_module_query( |
64 | db: &impl PersistentHirDatabase, | 64 | db: &impl PersistentHirDatabase, |
65 | module: Module, | 65 | module: Module, |
66 | ) -> Arc<LoweredModule> { | 66 | ) -> Arc<LoweredModule> { |
67 | db.lower_module(module).0 | 67 | db.lower_module_with_source_map(module).0 |
68 | } | ||
69 | |||
70 | pub(crate) fn lower_module_source_map_query( | ||
71 | db: &impl PersistentHirDatabase, | ||
72 | module: Module, | ||
73 | ) -> Arc<ImportSourceMap> { | ||
74 | db.lower_module(module).1 | ||
75 | } | 68 | } |
76 | 69 | ||
77 | pub(crate) fn lower_module_query( | 70 | pub(crate) fn lower_module_with_source_map_query( |
78 | db: &impl PersistentHirDatabase, | 71 | db: &impl PersistentHirDatabase, |
79 | module: Module, | 72 | module: Module, |
80 | ) -> (Arc<LoweredModule>, Arc<ImportSourceMap>) { | 73 | ) -> (Arc<LoweredModule>, Arc<ImportSourceMap>) { |
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 625a2ce45..ea20cd15a 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -157,7 +157,7 @@ pub fn macro_symbols(db: &impl HirDatabase, file_id: FileId) -> Vec<(SmolStr, Te | |||
157 | Some(it) => it, | 157 | Some(it) => it, |
158 | None => return Vec::new(), | 158 | None => return Vec::new(), |
159 | }; | 159 | }; |
160 | let items = db.lower_module_module(module); | 160 | let items = db.lower_module(module); |
161 | let mut res = Vec::new(); | 161 | let mut res = Vec::new(); |
162 | 162 | ||
163 | for macro_call_id in items | 163 | for macro_call_id in items |