fix(lsp): buffer should be second arg for supports_method

This commit is contained in:
Folke Lemaitre
2025-09-15 17:15:51 +02:00
parent 5668ad72ca
commit 44ade7fdea

View File

@@ -64,7 +64,7 @@ function M._check_methods(client, buffer)
for method, clients in pairs(M._supports_method) do
clients[client] = clients[client] or {}
if not clients[client][buffer] then
if client.supports_method and client:supports_method(method, { bufnr = buffer }) then
if client.supports_method and client:supports_method(method, buffer) then
clients[client][buffer] = true
vim.api.nvim_exec_autocmds("User", {
pattern = "LspSupportsMethod",
@@ -107,7 +107,7 @@ function M.on_supports_method(method, fn)
})
end
---@return _.lspconfig.options
---@return vim.lsp.Config
function M.get_config(server)
local configs = require("lspconfig.configs")
return rawget(configs, server)