diff options
Diffstat (limited to 'crates/ra_ide/src/references/rename.rs')
-rw-r--r-- | crates/ra_ide/src/references/rename.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 8735ec53c..d8ffb8c84 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs | |||
@@ -149,7 +149,7 @@ fn rename_to_self( | |||
149 | let source_file = sema.parse(position.file_id); | 149 | let source_file = sema.parse(position.file_id); |
150 | let syn = source_file.syntax(); | 150 | let syn = source_file.syntax(); |
151 | 151 | ||
152 | let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; | 152 | let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?; |
153 | let params = fn_def.param_list()?; | 153 | let params = fn_def.param_list()?; |
154 | if params.self_param().is_some() { | 154 | if params.self_param().is_some() { |
155 | return None; // method already has self param | 155 | return None; // method already has self param |
@@ -221,7 +221,7 @@ fn rename_self_to_param( | |||
221 | let syn = source_file.syntax(); | 221 | let syn = source_file.syntax(); |
222 | 222 | ||
223 | let text = sema.db.file_text(position.file_id); | 223 | let text = sema.db.file_text(position.file_id); |
224 | let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; | 224 | let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?; |
225 | let search_range = fn_def.syntax().text_range(); | 225 | let search_range = fn_def.syntax().text_range(); |
226 | 226 | ||
227 | let mut edits: Vec<SourceFileEdit> = vec![]; | 227 | let mut edits: Vec<SourceFileEdit> = vec![]; |