Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp: allow codeActions to results to not have an edit property #3555

Merged
merged 1 commit into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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