Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct callback logic on debuggin #699

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading