aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/buf.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2023-06-20 18:36:18 +0200
committerGitHub <noreply@github.com>2023-06-20 18:36:18 +0200
commit64f2691a984a5b1e2958d5656a910054982a6f0e (patch)
treeb02c4e0f3f5beefbe50e7193793e254df3cd9d66 /runtime/lua/vim/lsp/buf.lua
parent19eef8156bdd3539f10c9a39494cb64b88d777f5 (diff)
downloadrneovim-64f2691a984a5b1e2958d5656a910054982a6f0e.tar.gz
rneovim-64f2691a984a5b1e2958d5656a910054982a6f0e.tar.bz2
rneovim-64f2691a984a5b1e2958d5656a910054982a6f0e.zip
refactor(lsp): extract common execute command functionality (#24065)
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r--runtime/lua/vim/lsp/buf.lua18
1 files changed, 2 insertions, 16 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index c3deffc1f9..45056cf272 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -646,21 +646,7 @@ local function on_code_action_results(results, ctx, options)
end
if action.command then
local command = type(action.command) == 'table' and action.command or action
- local fn = client.commands[command.command] or vim.lsp.commands[command.command]
- if fn then
- local enriched_ctx = vim.deepcopy(ctx)
- enriched_ctx.client_id = client.id
- fn(command, enriched_ctx)
- else
- -- 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
+ client._exec_cmd(command, ctx)
end
end
@@ -697,7 +683,7 @@ local function on_code_action_results(results, ctx, options)
return
end
apply_action(resolved_action, client)
- end)
+ end, ctx.bufnr)
else
apply_action(action, client)
end