-
Notifications
You must be signed in to change notification settings - Fork 78
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
Allow debugging applications and tests in monorepos #85
Labels
wontfix
This will not be worked on
Comments
Closed
mcoqzeug
added a commit
to mcoqzeug/nvim-dap-go
that referenced
this issue
Sep 22, 2024
This potentially resolves leoluz#85. vscode-go sets dlv cwd based on the value of program. Reference: https://github.com/golang/vscode-go/blob/master/extension/src/goDebugConfiguration.ts#L545
mcoqzeug
added a commit
to mcoqzeug/nvim-dap-go
that referenced
this issue
Sep 22, 2024
This potentially resolves leoluz#85. vscode-go sets dlv cwd based on the value of program. Reference: https://github.com/golang/vscode-go/blob/master/extension/src/goDebugConfiguration.ts#L545
serpro69
added a commit
to serpro69/nvim-config
that referenced
this issue
Sep 26, 2024
Tried to setup DAP for go following nvim-dap documentation and using delve directly, as described in https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#go-using-delve-directly However, I was struggling to get DAP working and was getting "Error on launch: Failed to launch" errors all the time, when I discovered (via dap-ui) that the defaults of nvim-dap-go expects go.mod to be in the root of the project. At the same time, the "native" neotest adapter for go seems to have the same behavior and does not seem to support projects where go.mod is not in the root. This was originally described here leoluz/nvim-dap-go#80 (comment), and there's an open issue for this in nvim-dap-go: leoluz/nvim-dap-go#85 There is, however, another adapter for go - fredrikaverpil/neotest-golang - which seems to be more flexible and does support projects where go.mod is not in the root. After replacing the adapter and adding configurations as per https://github.com/fredrikaverpil/neotest-golang/?tab=readme-ov-file#example-configuration-debugging, I was finally able to get DAP working for go.
mcoqzeug
added a commit
to mcoqzeug/nvim-dap-go
that referenced
this issue
Oct 4, 2024
This potentially resolves leoluz#85. vscode-go sets dlv cwd based on the value of program. Reference: https://github.com/golang/vscode-go/blob/master/extension/src/goDebugConfiguration.ts#L545
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As explained in this issue it wasn't possible to launch the debugee (go application or test to be debugged) in projects where the
go.mod
is not in the cwd when delve is launched.#81 introduced a new attribute (
cwd
) in thedap.adaptars.go.executable
table to allow defining this value. However it partially fixes the problem as users would have to hardcode the value with the path to where the go.mod file is located. This isn't ideal as switching projects would require users to modify this attribute to set the new path.This proposal suggests:
go.mod
file in parent directories based on the path of the current buffer and dynamically set thedap.adaptars.go.executable.cwd
with it. See similar strategy here.The text was updated successfully, but these errors were encountered: