From 319356d0a0326bc2f6a9f79f9491077afc512b57 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Fri, 24 Feb 2023 22:46:53 +0100 Subject: [PATCH] add settings to rust-analyzer procMacro specifically --- lua/lang.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lua/lang.lua b/lua/lang.lua index 4f558b8..b484254 100644 --- a/lua/lang.lua +++ b/lua/lang.lua @@ -79,11 +79,34 @@ capabilities.textDocument.codeAction = { capabilities.textDocument.completion.completionItem.snippetSupport = true; -- LSPs -local servers = {"pylsp", "rust_analyzer", "vimls", "ocamllsp"} +local servers = {"pylsp", "vimls", "ocamllsp"} for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup {capabilities = capabilities, on_attach = on_attach} end +nvim_lsp.rust_analyzer.setup({ + on_attach = on_attach, + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + } + } +}) + -- symbols-outline.nvim vim.g.symbols_outline = { highlight_hovered_item = true,