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

The "remote" example from the README doesn't appear to work #105

Open
aktau opened this issue Dec 9, 2024 · 0 comments
Open

The "remote" example from the README doesn't appear to work #105

aktau opened this issue Dec 9, 2024 · 0 comments

Comments

@aktau
Copy link

aktau commented Dec 9, 2024

From the README:

lua require('dap-go').setup {
  dap_configurations = {
    {
      type = "go",
      name = "Attach remote",
      mode = "remote",
      request = "attach",
    },
  },
}

So I tried to connect to a running dlv dap, and it connects alright (after I hard-code the port), but then immediately I get that dlv exits with code 1. After reading nvim-dap docs, I figure this is due to the following:

local delve_config = {
type = "server",
port = config.delve.port,
executable = {
command = config.delve.path,
args = args,
detached = config.delve.detached,
cwd = config.delve.cwd,
},
options = {
initialize_timeout_sec = config.delve.initialize_timeout_sec,
},
}
.

As it turns out, if an executable attribute is set, mfussenegger/nvim-dap will spawn that executable, even when request = "attach". This is incognruent with mode = "remote". Docs: https://github.com/mfussenegger/nvim-dap/blob/580d6e526358afd0e4bba053e68fd59cf581a161/doc/dap.txt#L76-L78.

So I fixed my problem by commenting out that executable section. It'd probably make sense to make this executable section depend on whether or not mode == "remote".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant