diff options
Diffstat (limited to 'crates/base_db/src')
-rw-r--r-- | crates/base_db/src/lib.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs index 37a8432bd..1bc4690c9 100644 --- a/crates/base_db/src/lib.rs +++ b/crates/base_db/src/lib.rs | |||
@@ -171,16 +171,14 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> { | |||
171 | module_files: &FileSet, | 171 | module_files: &FileSet, |
172 | module_file: FileId, | 172 | module_file: FileId, |
173 | ) -> Option<Vec<(FileId, String)>> { | 173 | ) -> Option<Vec<(FileId, String)>> { |
174 | // TODO kb resolve path thinks that the input is a file... | 174 | match module_files.file_name_and_extension(module_file)? { |
175 | let directory_with_module_file = module_files.resolve_path(module_file, "/../")?; | 175 | ("mod", Some("rs")) | ("lib", Some("rs")) => { |
176 | let directory_with_applicable_modules = | 176 | module_files.list_files(module_file, None) |
177 | match module_files.file_name_and_extension(module_file)? { | 177 | } |
178 | ("mod", "rs") | ("lib", "rs") => Some(directory_with_module_file), | 178 | (directory_with_module_name, Some("rs")) => module_files |
179 | (directory_with_module_name, "rs") => module_files | 179 | .list_files(module_file, Some(&format!("../{}/", directory_with_module_name))), |
180 | .resolve_path(directory_with_module_file, directory_with_module_name), | 180 | _ => None, |
181 | _ => None, | 181 | } |
182 | }?; | ||
183 | Some(module_files.list_files(directory_with_applicable_modules)) | ||
184 | } | 182 | } |
185 | 183 | ||
186 | possible_sudmobules_opt(&self.source_root(module_file).file_set, module_file) | 184 | possible_sudmobules_opt(&self.source_root(module_file).file_set, module_file) |