mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 10:55:40 +00:00
feat(lsp)!: change handler signature #15504
This commit is contained in:
committed by
Justin M. Keyes
parent
f8e0011534
commit
cd8f6c5fb7
@@ -422,6 +422,21 @@ function M.clear_references()
|
||||
util.buf_clear_references()
|
||||
end
|
||||
|
||||
--- Requests code actions from all clients and calls the handler exactly once
|
||||
--- with all aggregated results
|
||||
---@private
|
||||
local function code_action_request(params)
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local method = 'textDocument/codeAction'
|
||||
vim.lsp.buf_request_all(bufnr, method, params, function(results)
|
||||
local actions = {}
|
||||
for _, r in pairs(results) do
|
||||
vim.list_extend(actions, r.result or {})
|
||||
end
|
||||
vim.lsp.handlers[method](nil, actions, {bufnr=bufnr, method=method})
|
||||
end)
|
||||
end
|
||||
|
||||
--- Selects a code action from the input list that is available at the current
|
||||
--- cursor position.
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user