fix(lsp): properly get buffer for dynamic capabilities (#3315)

This commit is contained in:
Lawrence Ho 2024-05-26 16:11:12 +08:00 committed by GitHub
parent 0f6ff53ce3
commit 07a137199c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,7 @@ function M.setup()
local ret = register_capability(err, res, ctx) local ret = register_capability(err, res, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id) local client = vim.lsp.get_client_by_id(ctx.client_id)
if client then if client then
for buffer in ipairs(client.attached_buffers) do for buffer in pairs(client.attached_buffers) do
vim.api.nvim_exec_autocmds("User", { vim.api.nvim_exec_autocmds("User", {
pattern = "LspDynamicCapability", pattern = "LspDynamicCapability",
data = { client_id = client.id, buffer = buffer }, data = { client_id = client.id, buffer = buffer },