From f4e519f52ef6a018fca60a557c3a47a017f0c195 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sat, 24 Dec 2022 13:57:54 -0600 Subject: fix(nvim,rust): fix rust_analyzer loading twice --- .../nvim/lua/tobyvin/plugins/rust-tools.lua | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/rust-tools.lua b/nvim/.config/nvim/lua/tobyvin/plugins/rust-tools.lua index 14ae777..b602a31 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/rust-tools.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/rust-tools.lua @@ -6,9 +6,20 @@ local M = { "nvim-lua/plenary.nvim", "mfussenegger/nvim-dap", }, + config = { + tools = { + hover_actions = { + border = "single", + }, + }, + server = require("tobyvin.lsp.configs").rust_analyzer, + dap = { adapter = require("tobyvin.plugins.dap.adapters").codelldb }, + }, } function M.init() + require("tobyvin.lsp.configs").rust_analyzer = nil + vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("tobyvin_rust-tools", { clear = true }), desc = "setup rust-tools", @@ -40,16 +51,4 @@ function M.init() }) end -function M.config() - require("rust-tools").setup({ - tools = { - hover_actions = { - border = "single", - }, - }, - server = require("tobyvin.lsp.configs").rust_analyzer, - dap = { adapter = require("tobyvin.plugins.dap.adapters").codelldb }, - }) -end - return M -- cgit v1.2.3-70-g09d2