mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
move rename to a new mod
This commit is contained in:
parent
bc0f79f74a
commit
5c8cb56506
8 changed files with 233 additions and 105 deletions
|
@ -35,14 +35,9 @@ pub fn module_from_declaration(
|
|||
let parent_module = module_from_file_id(db, file_id);
|
||||
let child_name = decl.name();
|
||||
match (parent_module, child_name) {
|
||||
(Some(parent_module), Some(child_name)) => {
|
||||
if let Some(child) = parent_module.child(db, &child_name.as_name()) {
|
||||
return Some(child);
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
(Some(parent_module), Some(child_name)) => parent_module.child(db, &child_name.as_name()),
|
||||
_ => None,
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Locates the module by position in the source code.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue