Compare commits
2 Commits
62f92944dc
...
c671f70423
Author | SHA1 | Date | |
---|---|---|---|
c671f70423 | |||
d54cd8782c |
@ -1,6 +1,17 @@
|
||||
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.diagnostic.config({
|
||||
severity_sort = true,
|
||||
underline = true,
|
||||
|
@ -110,21 +110,23 @@ return {
|
||||
default_settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
features = "all",
|
||||
loadOutDirsFromCheck = true,
|
||||
runBuildScripts = true,
|
||||
},
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
allTargets = true,
|
||||
check = {
|
||||
command = "clippy",
|
||||
features = "all",
|
||||
},
|
||||
procMacro = {
|
||||
checkOnSave = true,
|
||||
rustfmt = {
|
||||
rangeFormatting = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tools = {
|
||||
enable_clippy = true,
|
||||
executor = require("rustaceanvim.executors").termopen,
|
||||
|
Loading…
Reference in New Issue
Block a user