Files
nixos-dots/nvim/lua/configs/lspconfig.lua
2025-12-11 17:17:21 +01:00

35 lines
775 B
Lua

require("nvchad.configs.lspconfig").defaults()
local servers = { "html", "cssls", "rust_analyzer" }
vim.lsp.enable(servers)
-- Configure rust-analyzer with enhanced settings
vim.lsp.config.rust_analyzer = {
cmd = { "rust-analyzer" },
filetypes = { "rust" },
root_markers = { "Cargo.toml", "rust-project.json" },
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
buildScripts = {
enable = true,
},
},
checkOnSave = true,
check = {
command = "clippy",
},
procMacro = {
enable = true,
},
diagnostics = {
enable = true,
},
},
},
}
-- read :h vim.lsp.config for changing options of lsp servers