diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-06-25 09:13:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 09:13:01 -0700 |
commit | 5d792701cf3c8b9a0299ff1e90c843082c590d04 (patch) | |
tree | 7b8ed07e1549ae53c86ebf927ea022eba788a6fd /runtime/lua/vim/lsp/rpc.lua | |
parent | 7b5a233d64b9fbd99727271e14178e0132ec1e98 (diff) | |
parent | 58473178ff217079e6a0afd8926b262199477538 (diff) | |
download | rneovim-5d792701cf3c8b9a0299ff1e90c843082c590d04.tar.gz rneovim-5d792701cf3c8b9a0299ff1e90c843082c590d04.tar.bz2 rneovim-5d792701cf3c8b9a0299ff1e90c843082c590d04.zip |
Merge pull request #14904 from mfussenegger/nil-message-callbacks
fix(lsp): Handle nil message_callbacks
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r-- | runtime/lua/vim/lsp/rpc.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index ea12c97d40..4c5f02af9d 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -449,7 +449,7 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params) method = method; params = params; } - if result then + if result and message_callbacks then message_callbacks[message_id] = schedule_wrap(callback) return result, message_id else @@ -548,14 +548,14 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params) -- - The server will not send a result callback after this cancellation. -- - If the server sent this cancellation ACK after sending the result, the user of this RPC -- client will ignore the result themselves. - if result_id then + if result_id and message_callbacks then message_callbacks[result_id] = nil end return end end - local callback = message_callbacks[result_id] + local callback = message_callbacks and message_callbacks[result_id] if callback then message_callbacks[result_id] = nil validate { |