From 1f98a0656620bfc03dcb8bad87aa76a6304b3b73 Mon Sep 17 00:00:00 2001 From: Linda_pp Date: Mon, 3 May 2021 15:40:37 +0900 Subject: [PATCH] check if selected items are empty on handling code action (fix #1156) (#1157) --- autoload/lsp/ui/vim/code_action.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/lsp/ui/vim/code_action.vim b/autoload/lsp/ui/vim/code_action.vim index cff0bf2b0..e732d95fd 100644 --- a/autoload/lsp/ui/vim/code_action.vim +++ b/autoload/lsp/ui/vim/code_action.vim @@ -139,6 +139,7 @@ endfunction function! s:accept_code_action(sync, bufnr, data, ...) abort call lsp#internal#ui#quickpick#close() + if empty(a:data['items']) | return | endif let l:selected = a:data['items'][0]['item'] if s:handle_disabled_action(l:selected) | return | endif call s:handle_one_code_action(l:selected['server_name'], a:sync, a:bufnr, l:selected['code_action'])