Skip to content

Commit 0ab400d

Browse files
noib3AntoineGS
authored andcommitted
fix: replace vim.lsp.stop_client() with Client:stop()
1 parent 9688ca7 commit 0ab400d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lua/copilot/client/init.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ local M = {
2626
---@param id integer
2727
local function store_client_id(id)
2828
if M.id and M.id ~= id then
29-
if vim.lsp.get_client_by_id(M.id) then
30-
vim.lsp.stop_client(M.id)
29+
local client = vim.lsp.get_client_by_id(M.id)
30+
if client then
31+
client:stop()
3132
end
3233
end
3334

@@ -240,8 +241,9 @@ function M.teardown()
240241
vim.api.nvim_clear_autocmds({ group = M.augroup })
241242
end
242243

243-
if M.id then
244-
vim.lsp.stop_client(M.id)
244+
local client = vim.lsp.get_client_by_id(M.id)
245+
if client then
246+
client:stop()
245247
end
246248
end
247249

0 commit comments

Comments
 (0)