align lower module query names
This commit is contained in:
parent
fe5574b05a
commit
80bb7d86ec
@ -191,7 +191,7 @@ pub fn resolver(&self, db: &impl HirDatabase) -> Resolver {
|
||||
}
|
||||
|
||||
pub fn declarations(self, db: &impl HirDatabase) -> Vec<ModuleDef> {
|
||||
let (lowered_module, _) = db.lower_module(self);
|
||||
let lowered_module = db.lower_module(self);
|
||||
lowered_module
|
||||
.declarations
|
||||
.values()
|
||||
|
@ -47,7 +47,7 @@ pub(crate) fn import_source_impl(
|
||||
db: &impl HirDatabase,
|
||||
import: ImportId,
|
||||
) -> TreeArc<ast::PathSegment> {
|
||||
let source_map = db.lower_module_source_map(*self);
|
||||
let (_, source_map) = db.lower_module_with_source_map(*self);
|
||||
let (_, source) = self.definition_source(db);
|
||||
source_map.get(&source, import)
|
||||
}
|
||||
|
@ -48,14 +48,14 @@ fn submodules(
|
||||
delc_id: Option<SourceFileItemId>,
|
||||
) -> Arc<Vec<crate::module_tree::Submodule>>;
|
||||
|
||||
#[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_with_source_map_query)]
|
||||
fn lower_module_with_source_map(
|
||||
&self,
|
||||
module: Module,
|
||||
) -> (Arc<LoweredModule>, Arc<ImportSourceMap>);
|
||||
|
||||
#[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_query)]
|
||||
fn lower_module(&self, module: Module) -> (Arc<LoweredModule>, Arc<ImportSourceMap>);
|
||||
|
||||
#[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_module_query)]
|
||||
fn lower_module_module(&self, module: Module) -> Arc<LoweredModule>;
|
||||
|
||||
#[salsa::invoke(crate::nameres::lower::LoweredModule::lower_module_source_map_query)]
|
||||
fn lower_module_source_map(&self, module: Module) -> Arc<ImportSourceMap>;
|
||||
fn lower_module(&self, module: Module) -> Arc<LoweredModule>;
|
||||
|
||||
#[salsa::invoke(crate::nameres::ItemMap::item_map_query)]
|
||||
fn item_map(&self, krate: Crate) -> Arc<ItemMap>;
|
||||
|
@ -481,7 +481,7 @@ pub(crate) fn item_map_query(db: &impl PersistentHirDatabase, krate: Crate) -> A
|
||||
let module_tree = db.module_tree(krate);
|
||||
let input = module_tree
|
||||
.modules()
|
||||
.map(|module_id| (module_id, db.lower_module_module(Module { krate, module_id })))
|
||||
.map(|module_id| (module_id, db.lower_module(Module { krate, module_id })))
|
||||
.collect::<FxHashMap<_, _>>();
|
||||
|
||||
let resolver = Resolver::new(db, &input, krate);
|
||||
|
@ -60,21 +60,14 @@ pub fn get(&self, source: &ModuleSource, import: ImportId) -> TreeArc<ast::PathS
|
||||
}
|
||||
|
||||
impl LoweredModule {
|
||||
pub(crate) fn lower_module_module_query(
|
||||
pub(crate) fn lower_module_query(
|
||||
db: &impl PersistentHirDatabase,
|
||||
module: Module,
|
||||
) -> Arc<LoweredModule> {
|
||||
db.lower_module(module).0
|
||||
db.lower_module_with_source_map(module).0
|
||||
}
|
||||
|
||||
pub(crate) fn lower_module_source_map_query(
|
||||
db: &impl PersistentHirDatabase,
|
||||
module: Module,
|
||||
) -> Arc<ImportSourceMap> {
|
||||
db.lower_module(module).1
|
||||
}
|
||||
|
||||
pub(crate) fn lower_module_query(
|
||||
pub(crate) fn lower_module_with_source_map_query(
|
||||
db: &impl PersistentHirDatabase,
|
||||
module: Module,
|
||||
) -> (Arc<LoweredModule>, Arc<ImportSourceMap>) {
|
||||
|
@ -157,7 +157,7 @@ pub fn macro_symbols(db: &impl HirDatabase, file_id: FileId) -> Vec<(SmolStr, Te
|
||||
Some(it) => it,
|
||||
None => return Vec::new(),
|
||||
};
|
||||
let items = db.lower_module_module(module);
|
||||
let items = db.lower_module(module);
|
||||
let mut res = Vec::new();
|
||||
|
||||
for macro_call_id in items
|
||||
|
@ -223,8 +223,7 @@ pub(crate) fn collect_garbage(&mut self) {
|
||||
self.query(hir::db::FileItemsQuery).sweep(sweep);
|
||||
self.query(hir::db::FileItemQuery).sweep(sweep);
|
||||
|
||||
self.query(hir::db::LowerModuleQuery).sweep(sweep);
|
||||
self.query(hir::db::LowerModuleSourceMapQuery).sweep(sweep);
|
||||
self.query(hir::db::LowerModuleWithSourceMapQuery).sweep(sweep);
|
||||
self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user