From d9a36a736bfb91578a36505e7237212959bb55fe Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 27 Nov 2019 21:31:51 +0300 Subject: Rename module_id -> local_id --- crates/ra_hir_ty/src/test_db.rs | 4 ++-- crates/ra_hir_ty/src/tests.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index 874357008..1dc9793f9 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs @@ -73,9 +73,9 @@ impl TestDB { pub fn module_for_file(&self, file_id: FileId) -> ModuleId { for &krate in self.relevant_crates(file_id).iter() { let crate_def_map = self.crate_def_map(krate); - for (module_id, data) in crate_def_map.modules.iter() { + for (local_id, data) in crate_def_map.modules.iter() { if data.definition == Some(file_id) { - return ModuleId { krate, module_id }; + return ModuleId { krate, local_id }; } } } diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index c1744663a..c8461b447 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs @@ -4677,7 +4677,7 @@ fn type_at_pos(db: &TestDB, pos: FilePosition) -> String { let module = db.module_for_file(pos.file_id); let crate_def_map = db.crate_def_map(module.krate); - for decl in crate_def_map[module.module_id].scope.declarations() { + for decl in crate_def_map[module.local_id].scope.declarations() { if let ModuleDefId::FunctionId(func) = decl { let (_body, source_map) = db.body_with_source_map(func.into()); if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { @@ -4753,7 +4753,7 @@ fn infer(content: &str) -> String { let crate_def_map = db.crate_def_map(module.krate); let mut defs: Vec = Vec::new(); - visit_module(&db, &crate_def_map, module.module_id, &mut |it| defs.push(it)); + visit_module(&db, &crate_def_map, module.local_id, &mut |it| defs.push(it)); defs.sort_by_key(|def| match def { DefWithBodyId::FunctionId(it) => { it.lookup(&db).ast_id.to_node(&db).syntax().text_range().start() @@ -4796,7 +4796,7 @@ fn visit_module( } } } - ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.module_id, cb), + ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.local_id, cb), _ => (), } } @@ -4844,7 +4844,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { let events = db.log_executed(|| { let module = db.module_for_file(pos.file_id); let crate_def_map = db.crate_def_map(module.krate); - visit_module(&db, &crate_def_map, module.module_id, &mut |def| { + visit_module(&db, &crate_def_map, module.local_id, &mut |def| { db.infer(def); }); }); @@ -4866,7 +4866,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { let events = db.log_executed(|| { let module = db.module_for_file(pos.file_id); let crate_def_map = db.crate_def_map(module.krate); - visit_module(&db, &crate_def_map, module.module_id, &mut |def| { + visit_module(&db, &crate_def_map, module.local_id, &mut |def| { db.infer(def); }); }); -- cgit v1.2.3