mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 02:34:10 +00:00
fix(lsp): ensure bufnr is passed for buffer-local requests (#36325)
Problem: Some LSP method handlers were making requests without specifying a bufnr, defaulting to 0 (current). This works in most cases but fails when client attaches to background buffers, causing assertions in handlers to fail. Solution: Ensure bufnr is passed to Client.request for buffer-local methods.
This commit is contained in:
@@ -264,7 +264,7 @@ function M.on_diagnostic(error, result, ctx)
|
||||
if error.data == nil or error.data.retriggerRequest ~= false then
|
||||
local client = assert(lsp.get_client_by_id(ctx.client_id))
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
client:request(ctx.method, ctx.params)
|
||||
client:request(ctx.method, ctx.params, nil, ctx.bufnr)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user