mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-10 21:58:37 +00:00
internal: Replace Display impl for Name
This commit is contained in:
parent
2f840c2236
commit
c7ef6c25b7
108 changed files with 1045 additions and 656 deletions
|
@ -202,12 +202,13 @@ fn rename_mod(
|
|||
// - Module has submodules defined in separate files
|
||||
let dir_paths = match (is_mod_rs, has_detached_child, module.name(sema.db)) {
|
||||
// Go up one level since the anchor is inside the dir we're trying to rename
|
||||
(true, _, Some(mod_name)) => {
|
||||
Some((format!("../{}", mod_name.unescaped()), format!("../{new_name}")))
|
||||
}
|
||||
(true, _, Some(mod_name)) => Some((
|
||||
format!("../{}", mod_name.unescaped().display(sema.db)),
|
||||
format!("../{new_name}"),
|
||||
)),
|
||||
// The anchor is on the same level as target dir
|
||||
(false, true, Some(mod_name)) => {
|
||||
Some((mod_name.unescaped().to_string(), new_name.to_owned()))
|
||||
Some((mod_name.unescaped().display(sema.db).to_string(), new_name.to_owned()))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue