Skip to content

Commit

Permalink
Fix execute_command callback mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
aPisC authored and ckipp01 committed Feb 20, 2025
1 parent ef6e995 commit 5d27f49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ local M = {}
local function execute_command(command_params, callback)
lsp.buf_request_all(0, "workspace/executeCommand", command_params, function(responses)
local metals_id = util.find_metals_client_id()
local response = responses[metals_id]

for client_id, response in pairs(responses) do
if client_id ~= metals_id then
return
elseif callback then
if response then
if callback then
local context = response.ctx and response.ctx.method or ""
callback(response.err, context, response)
elseif response.err then
Expand Down

0 comments on commit 5d27f49

Please sign in to comment.