Closed prikhi closed 2 months ago
Nice one, thanks for taking the moment to lodge the issue and for posting the updated API. That makes it much easier:
This is the v0.9 api
get_active_clients({filter}) *vim.lsp.get_active_clients()*
Get active clients.
Parameters:
• {filter} (table|nil) A table with key-value pairs used to filter the
returned clients. The available keys are:
• id (number): Only return clients with the given id
• bufnr (number): Only return clients attached to this
buffer
• name (string): Only return clients with the given name
Return:
(table) List of |vim.lsp.client| objects
So, while not a direct name change only, should be seemingly straight forward 👍
Looks like we're only filtering by name, which is still supported in the updated api.
lua/zk/lsp.lua
:
local active_clients = vim.lsp.get_active_clients({ name = client_name })
@kabouzeid would this be the occasion to start making releases for zk-nvim
, in order to support api changes?
Or what was the approach before I came on board for this situation?
Tags? Or do we just support the latest build of neovim?
local active_clients = (vim.lsp.get_clients or vim.lsp.get_active_clients)({ name = client_name })
or vim.fn.has("nvim-0.10")
the if check isn't working somehow. As reported in #170 Reopening to check this out again. Although the latest commits will work anyway for v0.10.* users
With neovim nightly & the latest version of
zk-nvim
, I get the following warning when opening up a zk file:It seems like
get_clients
is just a simple renaming as the docs say it returns active clients?