From cc29449a60f87800f5b7f9b9a4e2f81bc335ffe3 Mon Sep 17 00:00:00 2001 From: tdback Date: Sun, 29 Dec 2024 21:48:18 -0500 Subject: fix: suppress rust-analyzer error message for `ServerCancelled` --- after/ftplugin/rust.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 after/ftplugin/rust.lua (limited to 'after/ftplugin/rust.lua') diff --git a/after/ftplugin/rust.lua b/after/ftplugin/rust.lua new file mode 100644 index 0000000..390e02f --- /dev/null +++ b/after/ftplugin/rust.lua @@ -0,0 +1,10 @@ +-- Fix: https://github.com/neovim/neovim/issues/30985 +for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do + local default_diagnostic_handler = vim.lsp.handlers[method] + vim.lsp.handlers[method] = function(err, result, context, config) + if err ~= nil and err.code == -32802 then + return + end + return default_diagnostic_handler(err, result, context, config) + end +end -- cgit v1.2.3