fix(lsp): resolve keymap capabilities over all buffer clients

This commit is contained in:
Folke Lemaitre
2023-07-02 12:43:16 +02:00
parent d0bc8b7dce
commit 36774c6058

View File

@ -66,6 +66,17 @@ function M.get()
end
function M.on_attach(client, buffer)
---@param method string
function M.has(buffer, method)
method = method:find("/") and method or "textDocument/" .. method
local clients = vim.lsp.get_active_clients({ bufnr = buffer })
for _, client in ipairs(clients) do
if client.supports_method(method) then
return true
end
end
return false
end
local Keys = require("lazy.core.handler.keys")
local keymaps = {} ---@type table<string,LazyKeys|{has?:string}>