From ec5fd3cb6ad1e512eac5990e4ae78bffc351729b Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sun, 15 Oct 2023 16:07:46 +0200 Subject: [PATCH] Ajout : fichier de configuration pour le LSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Première version avec inclusion de rust-analyzer qui sera modularisé par la suite --- config/nvim/lua/core/lsp.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 config/nvim/lua/core/lsp.lua diff --git a/config/nvim/lua/core/lsp.lua b/config/nvim/lua/core/lsp.lua new file mode 100644 index 0000000..43936f7 --- /dev/null +++ b/config/nvim/lua/core/lsp.lua @@ -0,0 +1,28 @@ +local nvim_lsp = require'lspconfig' + +local on_attach = function(client) + require'completion'.on_attach(client) +end + +nvim_lsp.rust_analyzer.setup({ + on_attach=on_attach, + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + } + } +}) +