aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-09-15 11:35:04 -0700
committerJustin M. Keyes <justinkz@gmail.com>2021-09-26 11:28:28 -0700
commit7b1315fe61131f787d9351ecd444346b95f5e49c (patch)
treedcb7355549dcdebdf40b18bbddc3af48cdefcb90 /runtime/lua/vim/lsp/handlers.lua
parent27bac13be66946e2cb2912a44185d18b0f856a32 (diff)
downloadrneovim-7b1315fe61131f787d9351ecd444346b95f5e49c.tar.gz
rneovim-7b1315fe61131f787d9351ecd444346b95f5e49c.tar.bz2
rneovim-7b1315fe61131f787d9351ecd444346b95f5e49c.zip
feat(lsp): improve logging (#15636)
* Simplify rpc encode/decode messages to rpc.send/rcp.receive * Make missing handlers message throw a warning * Clean up formatting style in log * Move all non-RPC loop messages to trace instead of debug * Add format func option to log to allow newlines in per log entry
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r--runtime/lua/vim/lsp/handlers.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 5ee2ddf86c..475b345e84 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -419,7 +419,7 @@ M['window/logMessage'] = function(_, result, ctx, _)
log.error(message)
elseif message_type == protocol.MessageType.Warning then
log.warn(message)
- elseif message_type == protocol.MessageType.Info then
+ elseif message_type == protocol.MessageType.Info or message_type == protocol.MessageType.Log then
log.info(message)
else
log.debug(message)
@@ -449,7 +449,7 @@ end
-- Add boilerplate error validation and logging for all of these.
for k, fn in pairs(M) do
M[k] = function(err, result, ctx, config)
- local _ = log.debug() and log.debug('default_handler', ctx.method, {
+ local _ = log.trace() and log.trace('default_handler', ctx.method, {
err = err, result = result, ctx=vim.inspect(ctx), config = config
})