Compare commits

..

2 Commits

Author SHA1 Message Date
0f6ff53ce3 chore(main): release 11.6.1 (#3292)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-23 17:41:03 +02:00
10ed3082a4 fix(lsp): use proper buffer for dynamic capabilities. Fixes #3246 2024-05-23 17:39:23 +02:00
2 changed files with 25 additions and 5 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## [11.6.1](https://github.com/LazyVim/LazyVim/compare/v11.6.0...v11.6.1) (2024-05-23)
### Bug Fixes
* **lsp:** use proper buffer for dynamic capabilities. Fixes [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([10ed308](https://github.com/LazyVim/LazyVim/commit/10ed3082a415b525628dfaebdcd007c7e96a5b87))
## [11.6.0](https://github.com/LazyVim/LazyVim/compare/v11.5.0...v11.6.0) (2024-05-23)

View File

@ -43,12 +43,13 @@ function M.setup()
---@diagnostic disable-next-line: no-unknown
local ret = register_capability(err, res, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id)
local buffer = vim.api.nvim_get_current_buf()
if client then
vim.api.nvim_exec_autocmds("User", {
pattern = "LspDynamicCapability",
data = { client_id = client.id, buffer = buffer },
})
for buffer in ipairs(client.attached_buffers) do
vim.api.nvim_exec_autocmds("User", {
pattern = "LspDynamicCapability",
data = { client_id = client.id, buffer = buffer },
})
end
end
return ret
end
@ -58,6 +59,18 @@ end
---@param client vim.lsp.Client
function M._check_methods(client, buffer)
-- don't trigger on invalid buffers
if not vim.api.nvim_buf_is_valid(buffer) then
return
end
-- don't trigger on non-listed buffers
if not vim.bo[buffer].buflisted then
return
end
-- don't trigger on nofile buffers
if vim.bo[buffer].buftype == "nofile" then
return
end
for method, clients in pairs(M._supports_method) do
clients[client] = clients[client] or {}
if not clients[client][buffer] then