aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorRasmus Ishøy Michelsen <42123601+RMichelsen@users.noreply.github.com>2020-09-22 21:54:34 +0200
committerGitHub <noreply@github.com>2020-09-22 21:54:34 +0200
commit4f8d98e583beb4c1abd5d57b9898548396633030 (patch)
treee56c62d41e393c793347814c2891861468c98d09 /runtime/lua/vim/lsp/rpc.lua
parent78539dda95e058299be9840c412ae333bfe69e5b (diff)
downloadrneovim-4f8d98e583beb4c1abd5d57b9898548396633030.tar.gz
rneovim-4f8d98e583beb4c1abd5d57b9898548396633030.tar.bz2
rneovim-4f8d98e583beb4c1abd5d57b9898548396633030.zip
lsp: Handle ContentModified the same way as RequestCancelled (#12803)
* Added the ContentModified error to be hidden from users, like RequestCancelled * Fixed tests (and ill-formed lua code) * Simplified if-expression
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r--runtime/lua/vim/lsp/rpc.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index 64080cf4f2..749a51fecc 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -494,10 +494,13 @@ local function start(cmd, cmd_args, handlers, extra_spawn_params)
decoded.error = convert_NIL(decoded.error)
decoded.result = convert_NIL(decoded.result)
- -- Do not surface RequestCancelled to users, it is RPC-internal.
- if decoded.error
- and decoded.error.code == protocol.ErrorCodes.RequestCancelled then
- local _ = log.debug() and log.debug("Received cancellation ack", decoded)
+ -- Do not surface RequestCancelled or ContentModified to users, it is RPC-internal.
+ if decoded.error then
+ if decoded.error.code == protocol.ErrorCodes.RequestCancelled then
+ local _ = log.debug() and log.debug("Received cancellation ack", decoded)
+ elseif decoded.error.code == protocol.ErrorCodes.ContentModified then
+ local _ = log.debug() and log.debug("Received content modified ack", decoded)
+ end
local result_id = tonumber(decoded.id)
-- Clear any callback since this is cancelled now.
-- This is safe to do assuming that these conditions hold: