Skip to content

Commit

Permalink
check if selected items are empty on handling code action (fix #1156) (
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd authored May 3, 2021
1 parent b689884 commit 1f98a06
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions autoload/lsp/ui/vim/code_action.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 1f98a06

Please sign in to comment.