aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/module/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/module/imp.rs')
-rw-r--r--crates/ra_hir/src/module/imp.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/ra_hir/src/module/imp.rs b/crates/ra_hir/src/module/imp.rs
index 76ea129a7..0eec38797 100644
--- a/crates/ra_hir/src/module/imp.rs
+++ b/crates/ra_hir/src/module/imp.rs
@@ -66,7 +66,7 @@ fn create_module_tree<'a>(
66 66
67 let source_root = db.source_root(source_root); 67 let source_root = db.source_root(source_root);
68 for &file_id in source_root.files.iter() { 68 for &file_id in source_root.files.iter() {
69 let source = ModuleSource::SourceFile(file_id); 69 let source = ModuleSource::new_file(db, file_id);
70 if visited.contains(&source) { 70 if visited.contains(&source) {
71 continue; // TODO: use explicit crate_roots here 71 continue; // TODO: use explicit crate_roots here
72 } 72 }
@@ -126,7 +126,7 @@ fn build_subtree(
126 visited, 126 visited,
127 roots, 127 roots,
128 Some(link), 128 Some(link),
129 ModuleSource::SourceFile(file_id), 129 ModuleSource::new_file(db, file_id),
130 ), 130 ),
131 }) 131 })
132 .collect::<Cancelable<Vec<_>>>()?; 132 .collect::<Cancelable<Vec<_>>>()?;
@@ -157,13 +157,8 @@ fn resolve_submodule(
157 name: &SmolStr, 157 name: &SmolStr,
158 file_resolver: &FileResolverImp, 158 file_resolver: &FileResolverImp,
159) -> (Vec<FileId>, Option<Problem>) { 159) -> (Vec<FileId>, Option<Problem>) {
160 let file_id = match source { 160 // TODO: handle submodules of inline modules properly
161 ModuleSource::SourceFile(it) => it, 161 let file_id = source.file_id();
162 ModuleSource::Module(..) => {
163 // TODO
164 return (Vec::new(), None);
165 }
166 };
167 let mod_name = file_resolver.file_stem(file_id); 162 let mod_name = file_resolver.file_stem(file_id);
168 let is_dir_owner = mod_name == "mod" || mod_name == "lib" || mod_name == "main"; 163 let is_dir_owner = mod_name == "mod" || mod_name == "lib" || mod_name == "main";
169 164