Skip to content

Commit

Permalink
fix: correct callback logic on debuggin (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 authored Dec 9, 2024
1 parent 1c6dec2 commit 6d4b3c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ local function execute_command(command_params, callback)
if client_id ~= metals_id then
return
elseif callback then
callback(response.err, response.ctx.method, responses)
local context = response.ctx and response.ctx.method or ""
callback(response.err, context, response)
elseif response.err then
log.error_and_show(string.format("Could not execute command: %s", response.err.message))
end
Expand Down
2 changes: 1 addition & 1 deletion lua/metals/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ local function setup_dap(execute_command)
-- really capture or care about the err and instead just make sure res is
-- there and not null.
if res then
local port = util.split_on(res.uri, ":")[3]
local port = util.split_on(res.result.uri, ":")[3]

callback({
type = "server",
Expand Down

0 comments on commit 6d4b3c3

Please sign in to comment.