Skip to content

Commit 6d4b3c3

Browse files
authored
fix: correct callback logic on debuggin (#699)
1 parent 1c6dec2 commit 6d4b3c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lua/metals.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ local function execute_command(command_params, callback)
3333
if client_id ~= metals_id then
3434
return
3535
elseif callback then
36-
callback(response.err, response.ctx.method, responses)
36+
local context = response.ctx and response.ctx.method or ""
37+
callback(response.err, context, response)
3738
elseif response.err then
3839
log.error_and_show(string.format("Could not execute command: %s", response.err.message))
3940
end

lua/metals/setup.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ local function setup_dap(execute_command)
135135
-- really capture or care about the err and instead just make sure res is
136136
-- there and not null.
137137
if res then
138-
local port = util.split_on(res.uri, ":")[3]
138+
local port = util.split_on(res.result.uri, ":")[3]
139139

140140
callback({
141141
type = "server",

0 commit comments

Comments
 (0)