diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2020-05-11 16:56:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 16:56:35 +0200 |
commit | 55b62a937c27715f7e6c299ae312c38edf08fa74 (patch) | |
tree | 10fdd2440100c5ebd7a57db6510159974d81bad1 /runtime/lua/vim/lsp/callbacks.lua | |
parent | 9816173fb3bdd7b42943ff770ddcd5c953a77163 (diff) | |
download | rneovim-55b62a937c27715f7e6c299ae312c38edf08fa74.tar.gz rneovim-55b62a937c27715f7e6c299ae312c38edf08fa74.tar.bz2 rneovim-55b62a937c27715f7e6c299ae312c38edf08fa74.zip |
LSP: Make applyEdit return a response (#12270)
According to the specification workspace/applyEdit needs to respond with
a `ApplyWorkspaceEditResponse`
See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit
This is a subset of https://github.com/neovim/neovim/pull/11607
Diffstat (limited to 'runtime/lua/vim/lsp/callbacks.lua')
-rw-r--r-- | runtime/lua/vim/lsp/callbacks.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/callbacks.lua b/runtime/lua/vim/lsp/callbacks.lua index 70d21be8e7..09ca4b61e4 100644 --- a/runtime/lua/vim/lsp/callbacks.lua +++ b/runtime/lua/vim/lsp/callbacks.lua @@ -17,7 +17,11 @@ M['workspace/applyEdit'] = function(_, _, workspace_edit) if workspace_edit.label then print("Workspace edit", workspace_edit.label) end - util.apply_workspace_edit(workspace_edit.edit) + local status, result = pcall(util.apply_workspace_edit, workspace_edit.edit) + return { + applied = status; + failureReason = result; + } end M['textDocument/publishDiagnostics'] = function(_, _, result) |