From d3133788ed35563ace10f788d81d747f4d946438 Mon Sep 17 00:00:00 2001 From: srdusr Date: Tue, 21 Mar 2023 23:56:13 +0200 Subject: Include rust-tools --- lua/plugins/lsp.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lua/plugins/lsp.lua') diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 855818f..1818640 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -296,6 +296,39 @@ require("lspconfig").rust_analyzer.setup{ } end +local opts = { + tools = { + runnables = { + use_telescope = true, + }, + inlay_hints = { + auto = true, + show_parameter_hints = false, + parameter_hints_prefix = "", + other_hints_prefix = "", + }, + }, + + -- all the opts to send to nvim-lspconfig + -- these override the defaults set by rust-tools.nvim + -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer + server = { + -- on_attach is a callback called when the language server attachs to the buffer + on_attach = on_attach, + settings = { + -- to enable rust-analyzer settings visit: + -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc + ["rust-analyzer"] = { + -- enable clippy on save + checkOnSave = { + command = "clippy", + }, + }, + }, + }, +} +require('rust-tools').setup(opts) + vim.diagnostic.config({ underline = false, signs = true, -- cgit v1.2.3