@@ -490,35 +490,34 @@ pub fn code_action(cx: &mut Context) {
494− ui::Menu::new(actions, false, (), move |editor, code_action, event| {
493+ let mut picker = ui::Menu::new(actions, (), move |editor, code_action, event| {
495− if event != PromptEvent::Validate {
494+ if event != PromptEvent::Validate {
499− // always present here
498+ // always present here
500− let code_action = code_action.unwrap();
499+ let code_action = code_action.unwrap();
502− match code_action {
501+ match code_action {
503− lsp::CodeActionOrCommand::Command(command) => {
502+ lsp::CodeActionOrCommand::Command(command) => {
504− log::debug!("code action command: {:?}", command);
503+ log::debug!("code action command: {:?}", command);
505− execute_lsp_command(editor, command.clone());
504+ execute_lsp_command(editor, command.clone());
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);
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);
514− // if code action provides both edit and command first the edit
513+ // if code action provides both edit and command first the edit
515− // should be applied and then the command
514+ // should be applied and then the command
516− if let Some(command) = &code_action.command {
515+ if let Some(command) = &code_action.command {
517− execute_lsp_command(editor, command.clone());
516+ execute_lsp_command(editor, command.clone());
522 picker.move_down(); // pre-select the first item
521 picker.move_down(); // pre-select the first item
524 let popup = Popup::new("code-action", picker);
523 let popup = Popup::new("code-action", picker);