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()
} }
}) })
lsp_config.rust_analyzer.setup({ local rust_analyzer_settings = {
settings = {
["rust-analyzer"] = {
cargo = { cargo = {
features = "all" features = "all"
}, },
rustfmt = {
-- needs to use nightly channel to use unstable options
extraArgs = { "+nightly" }
}
} }
-- 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"] = rust_analyzer_settings
} }
}) })