refactor(copilot): dont use deprecated get_clients

This commit is contained in:
Folke Lemaitre
2023-10-09 09:12:48 +02:00
parent bff3a99697
commit 22271cdbbc

View File

@ -33,7 +33,13 @@ return {
return icon .. (status.message or "")
end,
cond = function()
local ok, clients = pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
if not package.loaded["copilot"] then
return
end
local ok, clients = pcall(require("lazyvim.util").get_clients, { name = "copilot", bufnr = 0 })
if not ok then
return false
end
return ok and #clients > 0
end,
color = function()