Skip to content

Commit 1f98a06

Browse files
authored
check if selected items are empty on handling code action (fix #1156) (#1157)
1 parent b689884 commit 1f98a06

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

autoload/lsp/ui/vim/code_action.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ endfunction
139139

140140
function! s:accept_code_action(sync, bufnr, data, ...) abort
141141
call lsp#internal#ui#quickpick#close()
142+
if empty(a:data['items']) | return | endif
142143
let l:selected = a:data['items'][0]['item']
143144
if s:handle_disabled_action(l:selected) | return | endif
144145
call s:handle_one_code_action(l:selected['server_name'], a:sync, a:bufnr, l:selected['code_action'])

0 commit comments

Comments
 (0)