Skip to content

Commit 7e2963d

Browse files
authored
fix(lsp): config still overwritten by multiple clients (#875)
1 parent d95deb5 commit 7e2963d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lua/rustaceanvim/lsp/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ M.start = function(bufnr)
164164
bufnr = bufnr or vim.api.nvim_get_current_buf()
165165
local bufname = vim.api.nvim_buf_get_name(bufnr)
166166
local ra_config = vim.lsp.config[ra_client_name] or {}
167-
local client_config = vim.tbl_deep_extend('force', config.server, ra_config)
168-
--NOTE: We deep copy to prevent shared state between rust-analyzer clients
169-
local lsp_start_config = vim.deepcopy(client_config)
170-
---@cast lsp_start_config rustaceanvim.lsp.StartConfig
167+
-- NOTE: We deep copy to prevent shared state between rust-analyzer clients
168+
local client_config = vim.tbl_deep_extend('force', vim.deepcopy(config.server), ra_config)
169+
---@type rustaceanvim.lsp.StartConfig
170+
local lsp_start_config = vim.tbl_deep_extend('force', {}, client_config)
171171
cargo.get_config_root_dir(client_config, bufname, function(root_dir)
172172
if not root_dir then
173173
vim.notify(

0 commit comments

Comments
 (0)