diff options
Diffstat (limited to 'crates/ide/src/references')
-rw-r--r-- | crates/ide/src/references/rename.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 7dfc5043e..02b171bda 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
@@ -64,7 +64,7 @@ pub(crate) fn prepare_rename( | |||
64 | } | 64 | } |
65 | }; | 65 | }; |
66 | let name_like = sema | 66 | let name_like = sema |
67 | .find_node_at_offset_with_descend(&syntax, position.offset) | 67 | .find_node_at_offset_with_descend(syntax, position.offset) |
68 | .ok_or_else(|| format_err!("No references found at position"))?; | 68 | .ok_or_else(|| format_err!("No references found at position"))?; |
69 | let node = match &name_like { | 69 | let node = match &name_like { |
70 | ast::NameLike::Name(it) => it.syntax(), | 70 | ast::NameLike::Name(it) => it.syntax(), |
@@ -104,7 +104,7 @@ pub(crate) fn rename_with_semantics( | |||
104 | 104 | ||
105 | let def = find_definition(sema, syntax, position)?; | 105 | let def = find_definition(sema, syntax, position)?; |
106 | match def { | 106 | match def { |
107 | Definition::ModuleDef(ModuleDef::Module(module)) => rename_mod(&sema, module, new_name), | 107 | Definition::ModuleDef(ModuleDef::Module(module)) => rename_mod(sema, module, new_name), |
108 | Definition::SelfType(_) => bail!("Cannot rename `Self`"), | 108 | Definition::SelfType(_) => bail!("Cannot rename `Self`"), |
109 | Definition::ModuleDef(ModuleDef::BuiltinType(_)) => bail!("Cannot rename builtin type"), | 109 | Definition::ModuleDef(ModuleDef::BuiltinType(_)) => bail!("Cannot rename builtin type"), |
110 | def => rename_reference(sema, def, new_name), | 110 | def => rename_reference(sema, def, new_name), |
@@ -323,7 +323,7 @@ fn rename_reference( | |||
323 | } | 323 | } |
324 | let mut source_change = SourceChange::default(); | 324 | let mut source_change = SourceChange::default(); |
325 | source_change.extend(usages.iter().map(|(&file_id, references)| { | 325 | source_change.extend(usages.iter().map(|(&file_id, references)| { |
326 | (file_id, source_edit_from_references(&references, def, new_name)) | 326 | (file_id, source_edit_from_references(references, def, new_name)) |
327 | })); | 327 | })); |
328 | 328 | ||
329 | let (file_id, edit) = source_edit_from_def(sema, def, new_name)?; | 329 | let (file_id, edit) = source_edit_from_def(sema, def, new_name)?; |
@@ -413,7 +413,7 @@ fn rename_self_to_param( | |||
413 | let mut source_change = SourceChange::default(); | 413 | let mut source_change = SourceChange::default(); |
414 | source_change.insert_source_edit(file_id.original_file(sema.db), edit); | 414 | source_change.insert_source_edit(file_id.original_file(sema.db), edit); |
415 | source_change.extend(usages.iter().map(|(&file_id, references)| { | 415 | source_change.extend(usages.iter().map(|(&file_id, references)| { |
416 | (file_id, source_edit_from_references(&references, def, new_name)) | 416 | (file_id, source_edit_from_references(references, def, new_name)) |
417 | })); | 417 | })); |
418 | Ok(source_change) | 418 | Ok(source_change) |
419 | } | 419 | } |