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: do not add executable to adapter in launch request #91

Closed
Closed
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
10 changes: 8 additions & 2 deletions lua/dap-go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ local default_config = {
port = "${port}",
args = {},
build_flags = "",
-- Automativally handle the issue on Windows where delve needs
-- to be run in attched mode or it will fail (actually crashes).
-- Automatically handle the issue on Windows where delve needs
-- to be run in attached mode or it will fail (actually crashes).
detached = vim.fn.has("win32") == 0,
},
tests = {
Expand Down Expand Up @@ -91,6 +91,12 @@ local function setup_delve_adapter(dap, config)
host = "127.0.0.1"
end

-- Remove the executable if used in remote mode.
-- This will prevent the executable from being launched.
if client_config.mode == "remote" then
delve_config.executable = nil
end

local listener_addr = host .. ":" .. client_config.port
delve_config.port = client_config.port
delve_config.executable.args = { "dap", "-l", listener_addr }
Expand Down
Loading