From 94f7b63522cb7464a853c74a8431587db6434b12 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jun 2021 19:15:53 +0300 Subject: minor: less ambiguous name --- crates/ide_db/src/rename.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ide_db') 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 { /// Textual range of the identifier which will change when renaming this /// `Definition`. Note that some definitions, like buitin types, can't be /// renamed. - pub fn rename_range(self, sema: &Semantics) -> Option { + pub fn range_for_rename(self, sema: &Semantics) -> Option { // FIXME: the `original_file_range` calls here are wrong -- they never fail, // and _fall back_ to the entirety of the macro call. Such fall back is // incorrect for renames. The safe behavior would be to return an error for @@ -412,8 +412,9 @@ fn source_edit_from_def( def: Definition, new_name: &str, ) -> Result<(FileId, TextEdit)> { - let frange = - def.rename_range(sema).ok_or_else(|| format_err!("No identifier available to rename"))?; + let frange = def + .range_for_rename(sema) + .ok_or_else(|| format_err!("No identifier available to rename"))?; let mut replacement_text = String::new(); let mut repl_range = frange.range; -- cgit v1.2.3