fix(lsp): fix multi client handling in code action (#18869)

Fixes https://github.com/neovim/neovim/issues/18860

(cherry picked from commit e4df1c9b9e)
This commit is contained in:
Mathias Fussenegger
2022-06-05 16:43:32 +02:00
parent e820c6d7c3
commit b3d754ccd7
3 changed files with 75 additions and 1 deletions

View File

@@ -516,7 +516,14 @@ local function on_code_action_results(results, ctx)
enriched_ctx.client_id = client.id
fn(command, enriched_ctx)
else
M.execute_command(command)
-- Not using command directly to exclude extra properties,
-- see https://github.com/python-lsp/python-lsp-server/issues/146
local params = {
command = command.command,
arguments = command.arguments,
workDoneToken = command.workDoneToken,
}
client.request('workspace/executeCommand', params, nil, ctx.bufnr)
end
end
end