mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Refactor Module::from_source to properly descend from root file
This commit is contained in:
parent
bbb022d399
commit
9c7a2aef30
3 changed files with 44 additions and 33 deletions
|
@ -157,7 +157,7 @@ impl Module {
|
|||
}
|
||||
|
||||
/// Finds a child module with the specified name.
|
||||
pub fn child(self, db: &impl HirDatabase, name: &Name) -> Option<Module> {
|
||||
pub fn child(self, db: &impl DefDatabase, name: &Name) -> Option<Module> {
|
||||
let def_map = db.crate_def_map(self.id.krate);
|
||||
let child_id = def_map[self.id.module_id].children.get(name)?;
|
||||
Some(self.with_module_id(*child_id))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue