aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 9cdca82c4..8f9db68a2 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -465,14 +465,15 @@ pub fn handle_rename(world: ServerWorld, params: RenameParams) -> Result<Option<
465 .into()); 465 .into());
466 } 466 }
467 467
468 let change = world 468 let optional_change = world
469 .analysis() 469 .analysis()
470 .rename(FilePosition { file_id, offset }, &*params.new_name)?; 470 .rename(FilePosition { file_id, offset }, &*params.new_name)?;
471 if change.is_none() { 471 let change = match optional_change {
472 return Ok(None); 472 None => return Ok(None),
473 } 473 Some(it) => it,
474 };
474 475
475 let source_change_req = change.unwrap().try_conv_with(&world)?; 476 let source_change_req = change.try_conv_with(&world)?;
476 477
477 Ok(Some(source_change_req.workspace_edit)) 478 Ok(Some(source_change_req.workspace_edit))
478} 479}