align lower module query names

This commit is contained in:
Aleksey Kladov 2019-03-02 16:49:06 +03:00
parent fe5574b05a
commit 80bb7d86ec
7 changed files with 15 additions and 23 deletions

View file

@ -191,7 +191,7 @@ impl Module {
}
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()

View file

@ -47,7 +47,7 @@ impl Module {
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)
}

View file

@ -48,14 +48,14 @@ pub trait PersistentHirDatabase: SourceDatabase + AsRef<HirInterner> {
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>;

View file

@ -481,7 +481,7 @@ impl ItemMap {
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);

View file

@ -60,21 +60,14 @@ impl ImportSourceMap {
}
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>) {

View file

@ -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

View file

@ -223,8 +223,7 @@ impl RootDatabase {
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);
}
}