Skip to content

Commit

Permalink
fix(toggles): resolve neovim 0.9 support with `vim.lsp.get_active_cli…
Browse files Browse the repository at this point in the history
…ents`
  • Loading branch information
mehalter committed Nov 13, 2023
1 parent b088efb commit 0c8ff3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/astrolsp/toggles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ function M.buffer_semantic_tokens(bufnr, silent)
bufnr = bufnr or 0
vim.b[bufnr].semantic_tokens = not vim.b[bufnr].semantic_tokens
local toggled = false
for _, client in ipairs(vim.lsp.get_clients { bufnr = bufnr }) do
-- TODO: remove check after dropping support for Neovim v0.9
for _, client in ipairs((vim.lsp.get_clients or vim.lsp.get_active_clients) { bufnr = bufnr }) do
if client.server_capabilities.semanticTokensProvider then
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens and "start" or "stop"](bufnr, client.id)
toggled = true
Expand Down

0 comments on commit 0c8ff3b

Please sign in to comment.