From aa0d344581dcfd7f18c595688a4b2709b0f2421e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 15 Aug 2018 23:24:20 +0300 Subject: Edits with cursors --- crates/server/src/main_loop/handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/server/src/main_loop/handlers.rs') diff --git a/crates/server/src/main_loop/handlers.rs b/crates/server/src/main_loop/handlers.rs index 637bf1b24..078abfbfa 100644 --- a/crates/server/src/main_loop/handlers.rs +++ b/crates/server/src/main_loop/handlers.rs @@ -187,12 +187,12 @@ pub fn handle_execute_command( let arg: ActionRequest = from_value(arg)?; let file_id = arg.text_document.try_conv_with(&path_map)?; let file = world.file_syntax(file_id)?; - let edit = match arg.id { - ActionId::FlipComma => libeditor::flip_comma(&file, arg.offset).map(|edit| edit()), - ActionId::AddDerive => libeditor::add_derive(&file, arg.offset).map(|edit| edit()), + let action_result = match arg.id { + ActionId::FlipComma => libeditor::flip_comma(&file, arg.offset).map(|f| f()), + ActionId::AddDerive => libeditor::add_derive(&file, arg.offset).map(|f| f()), }; - let edit = match edit { - Some(edit) => edit, + let edit = match action_result { + Some(action_result) => action_result.edit, None => bail!("command not applicable"), }; let line_index = world.file_line_index(file_id)?; -- cgit v1.2.3