From 5ae1f17bcd76417aa2c5d60e77151f3a97816e91 Mon Sep 17 00:00:00 2001 From: "Nikolas (Daniel) Vincenti" <165183152+NikVince@users.noreply.github.com> Date: Sat, 26 Apr 2025 12:05:06 +0200 Subject: [PATCH] UPDATED init.lua to support more advanced Rust Analyzer LSP features. --- init.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3b5eb0dc..af87b5ac 100644 --- a/init.lua +++ b/init.lua @@ -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: