From d47963320562f8d8c6275562012943bd5cd95372 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 21 May 2025 05:45:42 +0200 Subject: [PATCH] fix(lsp): fix reloading custom servers --- lua/ow/lsp/server.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/ow/lsp/server.lua b/lua/ow/lsp/server.lua index 3f24053..88180fd 100644 --- a/lua/ow/lsp/server.lua +++ b/lua/ow/lsp/server.lua @@ -338,6 +338,7 @@ function M:deinit() self.linters = nil end + require("lspconfig.configs")[self.name] = nil require("lspconfig")[self.name] = nil end @@ -359,7 +360,7 @@ function M.new(name, config) local ok, resp = pcall(require, "lspconfig.configs." .. name) if not ok and config.lspconfig then local configs = require("lspconfig.configs") - configs[name] = { default_config = config.lspconfig } + configs[name] = { default_config = vim.deepcopy(config.lspconfig) } elseif ok then config.lspconfig = vim.tbl_deep_extend( "keep",