aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres/collector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres/collector.rs')
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs
index b8f6aac8f..cbce04315 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/ra_hir_def/src/nameres/collector.rs
@@ -777,11 +777,11 @@ impl ModCollector<'_, '_> {
777 name, 777 name,
778 path_attr, 778 path_attr,
779 ) { 779 ) {
780 Ok((file_id, mod_dir)) => { 780 Ok((file_id, is_mod_rs, mod_dir)) => {
781 let module_id = self.push_child_module( 781 let module_id = self.push_child_module(
782 name.clone(), 782 name.clone(),
783 ast_id, 783 ast_id,
784 Some(file_id), 784 Some((file_id, is_mod_rs)),
785 &visibility, 785 &visibility,
786 ); 786 );
787 let raw_items = self.def_collector.db.raw_items(file_id.into()); 787 let raw_items = self.def_collector.db.raw_items(file_id.into());
@@ -814,7 +814,7 @@ impl ModCollector<'_, '_> {
814 &mut self, 814 &mut self,
815 name: Name, 815 name: Name,
816 declaration: AstId<ast::Module>, 816 declaration: AstId<ast::Module>,
817 definition: Option<FileId>, 817 definition: Option<(FileId, bool)>,
818 visibility: &crate::visibility::RawVisibility, 818 visibility: &crate::visibility::RawVisibility,
819 ) -> LocalModuleId { 819 ) -> LocalModuleId {
820 let vis = self 820 let vis = self
@@ -827,7 +827,9 @@ impl ModCollector<'_, '_> {
827 modules[res].parent = Some(self.module_id); 827 modules[res].parent = Some(self.module_id);
828 modules[res].origin = match definition { 828 modules[res].origin = match definition {
829 None => ModuleOrigin::Inline { definition: declaration }, 829 None => ModuleOrigin::Inline { definition: declaration },
830 Some(definition) => ModuleOrigin::File { declaration, definition }, 830 Some((definition, is_mod_rs)) => {
831 ModuleOrigin::File { declaration, definition, is_mod_rs }
832 }
831 }; 833 };
832 for (name, mac) in modules[self.module_id].scope.collect_legacy_macros() { 834 for (name, mac) in modules[self.module_id].scope.collect_legacy_macros() {
833 modules[res].scope.define_legacy_macro(name, mac) 835 modules[res].scope.define_legacy_macro(name, mac)