From c540d91464c03ea114d04814199cd37a844fa620 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 13 Dec 2024 22:40:34 -0600 Subject: [PATCH] refactor(nvim): improve lsp log format --- users/price/dots/.config/nvim/lua/core/lsp.lua | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/users/price/dots/.config/nvim/lua/core/lsp.lua b/users/price/dots/.config/nvim/lua/core/lsp.lua index 5d1cd471..9e443cf7 100644 --- a/users/price/dots/.config/nvim/lua/core/lsp.lua +++ b/users/price/dots/.config/nvim/lua/core/lsp.lua @@ -1,17 +1,8 @@ local M = {} M.setup = function() - -- HACK: See https://github.com/neovim/neovim/issues/30985#issuecomment-2447329525 - -- This fixes an issue with "server cancelled the request" emissions from `rust-analyzer` - for _, method in ipairs({ "textDocument/diagnostic", "workspace/diagnostic" }) do - local default_diagnostic_handler = vim.lsp.handlers[method] - vim.lsp.handlers[method] = function(error, result, ctx, config) - if error ~= nil and error.code == -32802 then - return - end - return default_diagnostic_handler(error, result, ctx, config) - end - end + vim.lsp.set_log_level(vim.log.levels.DEBUG) + vim.lsp.log.set_format_func(vim.inspect) vim.diagnostic.config({ severity_sort = true, underline = true,