1
0

Update rust-analyzer config

This commit is contained in:
Patrick Auernig 2024-02-11 21:32:21 +01:00
parent 42f8655dbc
commit 73b53d408a

View File

@ -65,17 +65,22 @@ spec.config = function()
}
})
local rust_analyzer_settings = {
cargo = {
features = "all"
},
}
-- Don't have rustup available if using nix shell
if vim.fn.executable("rustup") == 1 then
rust_analyzer_settings = vim.tbl_extend("keep", rust_analyzer_settings, {
rustfmt = { extraArgs = { "+nightly" } }
})
end
lsp_config.rust_analyzer.setup({
settings = {
["rust-analyzer"] = {
cargo = {
features = "all"
},
rustfmt = {
-- needs to use nightly channel to use unstable options
extraArgs = { "+nightly" }
}
}
["rust-analyzer"] = rust_analyzer_settings
}
})