Skip to content

Commit

Permalink
fix(lsp): update keymaps *after* registering capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 2, 2023
1 parent bbaf470 commit a981682
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/lazyvim/plugins/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ return {
local register_capability = vim.lsp.handlers["client/registerCapability"]

vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
local ret = register_capability(err, res, ctx)
local client_id = ctx.client_id
---@type lsp.Client
local client = vim.lsp.get_client_by_id(client_id)
local buffer = vim.api.nvim_get_current_buf()
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
return register_capability(err, res, ctx)
return ret
end

-- diagnostics
Expand Down

0 comments on commit a981682

Please sign in to comment.