diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-02-08 09:24:47 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-02-08 11:11:46 +0000 |
commit | 1f9da3d0835af2cfe937de250c2cde3a59e1677e (patch) | |
tree | 08acc0f5ea7259e81714f833522e9b49bfe20591 /runtime/lua/vim/lsp/handlers.lua | |
parent | 2a7c4aca422f99f3bd3a38425b660b94b5518469 (diff) | |
download | rneovim-1f9da3d0835af2cfe937de250c2cde3a59e1677e.tar.gz rneovim-1f9da3d0835af2cfe937de250c2cde3a59e1677e.tar.bz2 rneovim-1f9da3d0835af2cfe937de250c2cde3a59e1677e.zip |
refactor(lsp): tidy up logging
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 26a71487e2..2fa539d963 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -413,9 +413,7 @@ M[ms.textDocument_hover] = M.hover ---(`textDocument/definition` can return `Location` or `Location[]` local function location_handler(_, result, ctx, config) if result == nil or vim.tbl_isempty(result) then - if log.info() then - log.info(ctx.method, 'No location found') - end + log.info(ctx.method, 'No location found') return nil end local client = assert(vim.lsp.get_client_by_id(ctx.client_id)) @@ -649,13 +647,14 @@ 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.trace() - and log.trace('default_handler', ctx.method, { + if log.trace() then + log.trace('default_handler', ctx.method, { err = err, result = result, ctx = vim.inspect(ctx), config = config, }) + end if err then -- LSP spec: |