mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(lsp): include original request params in handler ctx
This is mostly motivated by https://github.com/neovim/neovim/issues/12326 Client side commands might need to access the original request parameters. Currently this is already possible by using closures with `vim.lsp.buf_request`, but the global handlers so far couldn't access the request parameters.
This commit is contained in:
@@ -2353,6 +2353,10 @@ describe('LSP', function()
|
||||
eq(0, signal, "exit signal", fake_lsp_logfile)
|
||||
end;
|
||||
on_handler = function(err, result, ctx)
|
||||
-- Don't compare & assert params, they're not relevant for the testcase
|
||||
-- This allows us to be lazy and avoid declaring them
|
||||
ctx.params = nil
|
||||
|
||||
eq(table.remove(test.expected_handlers), {err, result, ctx}, "expected handler")
|
||||
if ctx.method == 'start' then
|
||||
exec_lua("vim.lsp.buf.rename()")
|
||||
|
||||
Reference in New Issue
Block a user