aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2022-09-20 09:28:23 +0200
committerGitHub <noreply@github.com>2022-09-20 09:28:23 +0200
commit10196f1b462400b8a4a9e8f13893da2514f8c850 (patch)
treec0a2f483aa487cc2bc4ca2032a0dca2bfba3d569 /runtime/lua/vim/lsp/rpc.lua
parenta0e6e767a617d79983ac4982850dee6d95ed5b56 (diff)
downloadrneovim-10196f1b462400b8a4a9e8f13893da2514f8c850.tar.gz
rneovim-10196f1b462400b8a4a9e8f13893da2514f8c850.tar.bz2
rneovim-10196f1b462400b8a4a9e8f13893da2514f8c850.zip
fix(lsp): support `false` result in handlers (#20252)
Closes https://github.com/neovim/neovim/issues/20111
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r--runtime/lua/vim/lsp/rpc.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index 7d047f8958..755c0ffc6f 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -405,8 +405,7 @@ function Client:handle_body(body)
{ status = status, result = result, err = err }
)
if status then
- if not (result or err) then
- -- TODO this can be a problem if `null` is sent for result. needs vim.NIL
+ if result == nil and err == nil then
error(
string.format(
'method %q: either a result or an error must be sent to the server in response',