Allow debugging applications and tests in monorepos #85

Closed
opened 2024-05-02 04:45:59 +03:00 by leoluz · 2 comments
leoluz commented 2024-05-02 04:45:59 +03:00 (Migrated from github.com)

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.

https://github.com/leoluz/nvim-dap-go/pull/81 introduced a new attribute (cwd) in the dap.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:

  • Investigate a strategy to find the path of the closer go.mod file in parent directories based on the path of the current buffer and dynamically set the dap.adaptars.go.executable.cwd with it. See similar strategy here.
  • Provide proper documentation instructing users about when and how to use this feature.
As explained [in this issue](https://github.com/leoluz/nvim-dap-go/issues/80#issuecomment-2082055692) 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. https://github.com/leoluz/nvim-dap-go/pull/81 introduced a new attribute (`cwd`) in the `dap.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: - Investigate a strategy to find the path of the closer `go.mod` file in parent directories based on the path of the current buffer and dynamically set the `dap.adaptars.go.executable.cwd` with it. See [similar strategy here](https://stackoverflow.com/questions/61163306/running-go-test-in-parent-directory-of-multiple-go-modules). - Provide proper documentation instructing users about when and how to use this feature.
stale[bot] commented 2024-11-04 04:13:26 +03:00 (Migrated from github.com)

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.

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.
stale[bot] commented 2025-08-05 03:25:30 +03:00 (Migrated from github.com)

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.

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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NeonXP/nvim-dap-go#85
No description provided.