fix(lsp): stop using deprecated client.supports_method function (#3468)
Some checks failed
Tests / unit tests (brew update && brew install ripgrep, macos-latest, nightly) (push) Has been cancelled
Tests / unit tests (brew update && brew install ripgrep, macos-latest, v0.10.0) (push) Has been cancelled
Tests / unit tests (brew update && brew install ripgrep, macos-latest, v0.9.5) (push) Has been cancelled
Tests / unit tests (choco install ripgrep, windows-2022, nightly) (push) Has been cancelled
Tests / unit tests (choco install ripgrep, windows-2022, v0.10.0) (push) Has been cancelled
Tests / unit tests (choco install ripgrep, windows-2022, v0.9.5) (push) Has been cancelled
Tests / unit tests (sudo apt-get update && sudo apt-get install -y ripgrep, ubuntu-22.04, nightly) (push) Has been cancelled
Tests / unit tests (sudo apt-get update && sudo apt-get install -y ripgrep, ubuntu-22.04, v0.10.0) (push) Has been cancelled
Tests / unit tests (sudo apt-get update && sudo apt-get install -y ripgrep, ubuntu-22.04, v0.9.5) (push) Has been cancelled
Linting and style checking / Luacheck (push) Has been cancelled
Linting and style checking / stylua (push) Has been cancelled

This commit is contained in:
chupson
2025-05-12 03:21:28 +02:00
committed by GitHub
parent a4ed82509c
commit b4da76be54

View File

@@ -506,8 +506,14 @@ local function check_capabilities(method, bufnr)
local clients = get_clients { bufnr = bufnr } local clients = get_clients { bufnr = bufnr }
for _, client in pairs(clients) do for _, client in pairs(clients) do
if client.supports_method(method, { bufnr = bufnr }) then if vim.fn.has "nvim-0.11" == 1 then
return true if client:supports_method(method, bufnr) then
return true
end
else
if client.supports_method(method, { bufnr = bufnr }) then
return true
end
end end
end end