aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-14 17:15:53 +0100
committerAleksey Kladov <[email protected]>2021-06-14 17:16:03 +0100
commit94f7b63522cb7464a853c74a8431587db6434b12 (patch)
tree34821fc779fa38fada12a98ec3cb6f255e391605 /crates/ide_db
parentda534bdd074788e47b5dae76998b8f8535ea7257 (diff)
minor: less ambiguous name
Diffstat (limited to 'crates/ide_db')
-rw-r--r--crates/ide_db/src/rename.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ide_db/src/rename.rs b/crates/ide_db/src/rename.rs
index d77602453..82855725f 100644
--- a/crates/ide_db/src/rename.rs
+++ b/crates/ide_db/src/rename.rs
@@ -80,7 +80,7 @@ impl Definition {
80 /// Textual range of the identifier which will change when renaming this 80 /// Textual range of the identifier which will change when renaming this
81 /// `Definition`. Note that some definitions, like buitin types, can't be 81 /// `Definition`. Note that some definitions, like buitin types, can't be
82 /// renamed. 82 /// renamed.
83 pub fn rename_range(self, sema: &Semantics<RootDatabase>) -> Option<FileRange> { 83 pub fn range_for_rename(self, sema: &Semantics<RootDatabase>) -> Option<FileRange> {
84 // FIXME: the `original_file_range` calls here are wrong -- they never fail, 84 // FIXME: the `original_file_range` calls here are wrong -- they never fail,
85 // and _fall back_ to the entirety of the macro call. Such fall back is 85 // and _fall back_ to the entirety of the macro call. Such fall back is
86 // incorrect for renames. The safe behavior would be to return an error for 86 // incorrect for renames. The safe behavior would be to return an error for
@@ -412,8 +412,9 @@ fn source_edit_from_def(
412 def: Definition, 412 def: Definition,
413 new_name: &str, 413 new_name: &str,
414) -> Result<(FileId, TextEdit)> { 414) -> Result<(FileId, TextEdit)> {
415 let frange = 415 let frange = def
416 def.rename_range(sema).ok_or_else(|| format_err!("No identifier available to rename"))?; 416 .range_for_rename(sema)
417 .ok_or_else(|| format_err!("No identifier available to rename"))?;
417 418
418 let mut replacement_text = String::new(); 419 let mut replacement_text = String::new();
419 let mut repl_range = frange.range; 420 let mut repl_range = frange.range;