From a718b42adebaf487a36217236b25fc8327c494e3 Mon Sep 17 00:00:00 2001 From: Antoine Gaudreau Simard Date: Fri, 21 Mar 2025 07:04:15 -0400 Subject: [PATCH] fix: stop old client if folder changed and new LSP was spawned --- lua/copilot/client.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/copilot/client.lua b/lua/copilot/client.lua index c501e0be..3b6a99ae 100644 --- a/lua/copilot/client.lua +++ b/lua/copilot/client.lua @@ -23,8 +23,7 @@ local M = { local function store_client_id(id) if M.id and M.id ~= id then if vim.lsp.get_client_by_id(M.id) then - logger.error("unexpectedly started multiple copilot servers") - return + vim.lsp.stop_client(M.id) end end