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

Add a debug adapter on start #498

Open
adinhodovic opened this issue Aug 27, 2024 · 2 comments
Open

Add a debug adapter on start #498

adinhodovic opened this issue Aug 27, 2024 · 2 comments

Comments

@adinhodovic
Copy link

Can we add a debug adapter for DAP that gets added on initialization? Currently I run GoDebug and then require("neotest").run.run({ strategy = "dap" }) to have a debug adapter for Go available. Otherwise if I run neotest at first the debug adapter is not available for go.

@ray-x
Copy link
Owner

ray-x commented Aug 28, 2024

You can call require('go.dap').run() to startup a dap from go.nvim
Alternatively, there is a standalone go dap plugin you can use with neotest.

@adinhodovic
Copy link
Author

You can call require('go.dap').run() to startup a dap from go.nvim Alternatively, there is a standalone go dap plugin you can use with neotest.

That's fair but I'd like the adapter here

go.nvim/lua/go/dap.lua

Lines 386 to 398 in 8389adb

dap.adapters.go = function(callback, config)
if config.request == 'attach' and config.mode == 'remote' and config.host then
callback({ type = 'server', host = config.host, port = config.port, options = con_options })
return
end
stdout = vim.loop.new_pipe(false)
stderr = vim.loop.new_pipe(false)
local pid_or_err
port = config.port or port
local host = config.host or '127.0.0.1'
local addr = string.format('%s:%d', host, port)
to be available from the initialization of the plugin. So I don't have to use .run() to have a dap adapter available for dap. Does that make sense?

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

2 participants