fix(lsp): support false result in handlers (#20252)

Closes https://github.com/neovim/neovim/issues/20111
This commit is contained in:
Mathias Fußenegger
2022-09-20 09:28:23 +02:00
committed by GitHub
parent a0e6e767a6
commit 10196f1b46
2 changed files with 72 additions and 2 deletions

View File

@ -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',