UPDATED init.lua to support more advanced Rust Analyzer LSP features.

This commit is contained in:
Nikolas (Daniel) Vincenti 2025-04-26 12:05:06 +02:00
parent fc3f20a29b
commit 5ae1f17bcd
1 changed files with 28 additions and 1 deletions

View File

@ -666,7 +666,34 @@ require('lazy').setup({
clangd = {},
-- gopls = {},
-- pyright = {},
rust_analyzer = {},
rust_analyzer = {
settings = {
['rust-analyzer'] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
},
-- Add clippy lints for better code suggestions
checkOnSave = {
command = 'clippy',
extraArgs = { '--no-deps' },
},
procMacro = {
enable = true,
ignored = {
['async-trait'] = { 'async_trait' },
['napi-derive'] = { 'napi' },
['async-recursion'] = { 'async_recursion' },
},
},
-- Enable experimental features
experimental = {
procAttrMacros = true,
},
},
},
},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful: