@@ -490,35 +490,34 @@ pub fn code_action(cx: &mut Context) {
490490 _ => 7,
491491 });
492492
493− let mut picker =
494− ui::Menu::new(actions, false, (), move |editor, code_action, event| {
495− if event != PromptEvent::Validate {
496− return;
497− }
493+ let mut picker = ui::Menu::new(actions, (), move |editor, code_action, event| {
494+ if event != PromptEvent::Validate {
495+ return;
496+ }
498497
499− // always present here
500− let code_action = code_action.unwrap();
498+ // always present here
499+ let code_action = code_action.unwrap();
501500
502− match code_action {
503− lsp::CodeActionOrCommand::Command(command) => {
504− log::debug!("code action command: {:?}", command);
505− execute_lsp_command(editor, command.clone());
501+ match code_action {
502+ lsp::CodeActionOrCommand::Command(command) => {
503+ log::debug!("code action command: {:?}", command);
504+ execute_lsp_command(editor, command.clone());
505+ }
506+ lsp::CodeActionOrCommand::CodeAction(code_action) => {
507+ log::debug!("code action: {:?}", code_action);
508+ if let Some(ref workspace_edit) = code_action.edit {
509+ log::debug!("edit: {:?}", workspace_edit);
510+ apply_workspace_edit(editor, offset_encoding, workspace_edit);
506511 }
507− lsp::CodeActionOrCommand::CodeAction(code_action) => {
508− log::debug!("code action: {:?}", code_action);
509− if let Some(ref workspace_edit) = code_action.edit {
510− log::debug!("edit: {:?}", workspace_edit);
511− apply_workspace_edit(editor, offset_encoding, workspace_edit);
512− }
513512
514− // if code action provides both edit and command first the edit
515− // should be applied and then the command
516− if let Some(command) = &code_action.command {
517− execute_lsp_command(editor, command.clone());
518− }
513+ // if code action provides both edit and command first the edit
514+ // should be applied and then the command
515+ if let Some(command) = &code_action.command {
516+ execute_lsp_command(editor, command.clone());
519517 }
520518 }
521− });
519+ }
520+ });
522521 picker.move_down(); // pre-select the first item
523522
524523 let popup = Popup::new("code-action", picker);