nvim: rust-analyzer config

This commit is contained in:
Daniel Lundin 2024-03-25 19:30:23 +01:00
parent 71f2b5356a
commit 57ad37b67e

View file

@ -3,15 +3,10 @@ return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = { opts = {
inlay_hints = { enabled = true }, inlay_hints = { enabled = true },
-- capabilities = {
-- workspace = {
-- didChangeWatchedFiles = {
-- dynamicRegistration = false,
-- },
-- },
-- },
servers = { servers = {
rust_analyzer = { rust_analyzer = {
mason = false,
targetDir = true,
keys = { keys = {
{ "K", "<cmd>RustHoverActions<cr>", desc = "Hover Actions (Rust)" }, { "K", "<cmd>RustHoverActions<cr>", desc = "Hover Actions (Rust)" },
{ "<leader>cR", "<cmd>RustCodeAction<cr>", desc = "Code Action (Rust)" }, { "<leader>cR", "<cmd>RustCodeAction<cr>", desc = "Code Action (Rust)" },
@ -23,12 +18,7 @@ return {
allFeatures = true, allFeatures = true,
loadOutDirsFromCheck = true, loadOutDirsFromCheck = true,
runBuildScripts = true, runBuildScripts = true,
}, targetDir = true,
-- Add clippy lints for Rust.
checkOnSave = {
allFeatures = true,
command = "clippy",
extraArgs = { "--no-deps" },
}, },
procMacro = { procMacro = {
enable = true, enable = true,