Skip to content

Commit

Permalink
[bug] Fix Remote Debug Connection
Browse files Browse the repository at this point in the history
Introduce dlv_cfg var to allow us to decide if we should use the
executable config, in the case of a remote connection we do not want to
make use of this.

Signed-off-by: Luke Mallon (Nalum) <[email protected]>
  • Loading branch information
Nalum committed Dec 12, 2024
1 parent 6aa8816 commit 37d5ac0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lua/dap-go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,18 @@ local function setup_delve_adapter(dap, config)
end

local listener_addr = host .. ":" .. client_config.port
delve_config.port = client_config.port
delve_config.executable.args = { "dap", "-l", listener_addr }
local dlv_cfg = {
type = delve_config.type,
port = client_config.port,
options = delve_config.options,
}

if client_config.mode ~= "remote" then
dlv_cfg.executable = delve_config.executable
dlv_cfg.executable.args = { "dap", "-l", listener_addr }
end

callback(delve_config)
callback(dlv_cfg)
end
end

Expand Down

0 comments on commit 37d5ac0

Please sign in to comment.