diff options
author | tdback <tyler@tdback.net> | 2024-12-29 21:48:18 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2024-12-29 21:48:18 -0500 |
commit | cc29449a60f87800f5b7f9b9a4e2f81bc335ffe3 (patch) | |
tree | 4daf62da99e2970ec1129d37c04e8b7fd53cca63 /after/ftplugin | |
parent | b3db48e2096c19df4f49eaec0135ee05c3559a40 (diff) |
fix: suppress rust-analyzer error message for `ServerCancelled`
Diffstat (limited to 'after/ftplugin')
-rw-r--r-- | after/ftplugin/rust.lua | 10 |
1 files changed, 10 insertions, 0 deletions
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 |