Skip to content

Commit

Permalink
fix(lsp): resolve keymap capabilities over all buffer clients
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 2, 2023
1 parent d0bc8b7 commit 36774c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lua/lazyvim/plugins/lsp/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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}>

Expand Down

0 comments on commit 36774c6

Please sign in to comment.