Skip to content

Commit

Permalink
Merge pull request #3555 from bhcleek/lsp/code-action
Browse files Browse the repository at this point in the history
lsp: allow codeActions to results to not have an edit property
  • Loading branch information
bhcleek committed May 31, 2023
2 parents c6cf8b9 + b9fda8f commit cb91755
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoload/go/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1794,10 +1794,6 @@ function! s:handleCodeAction(kind, cmd, msg) abort dict

for l:item in a:msg
if get(l:item, 'kind', '') is a:kind
if !has_key(l:item, 'edit')
continue
endif

if has_key(l:item, 'disabled') && get(l:item.disabled, 'reason', '') isnot ''
call go#util#EchoWarning(printf('code action is disabled: %s', l:item.disabled.reason))
continue
Expand All @@ -1810,6 +1806,10 @@ function! s:handleCodeAction(kind, cmd, msg) abort dict
endif
endif

if !has_key(l:item, 'edit')
continue
endif

if !has_key(l:item.edit, 'documentChanges')
continue
endif
Expand Down

0 comments on commit cb91755

Please sign in to comment.