Skip to content

Commit

Permalink
fix: Stop using deprecated buf_get_clients
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewferrier committed May 25, 2024
1 parent d1ac69c commit 8b1a814
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lua/wrapping/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,19 @@ local function likely_nontextual_language()
-- If an LSP provider supports these capabilities it's almost certainly not
-- a textual language, and therefore we should use hard wrapping

for _, client in pairs(vim.lsp.buf_get_clients(0)) do
if client.definitionProvider or client.signatureHelpProvider then
local get_clients

if vim.fn.has("nvim-0.10") == 1 then
get_clients = vim.lsp.get_clients
else
get_clients = vim.lsp.get_active_clients
end

for _, client in pairs(get_clients({ bufnr = 0 })) do
if
client.server_capabilities.definitionProvider
or client.server_capabilities.signatureHelpProvider
then
return true
end
end
Expand Down

0 comments on commit 8b1a814

Please sign in to comment.