Skip to content

Commit

Permalink
lsp(rust): work around server cancelled request issue with latest rust
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Nov 27, 2024
1 parent 32c7c09 commit 113e6f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/nxvim/lsp/plugins/mason/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ mason_lspconfig.setup_handlers({
server_opts.root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc")
elseif server == "jsonls" then
server_opts.init_options = { provideFormatter = false } -- Use prettierd as formatter.
elseif server == "rust_analyzer" then
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
elseif server == "zls" then
vim.g.zig_fmt_autosave = 0
end
Expand Down

0 comments on commit 113e6f1

Please sign in to comment.