Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support trimpath when debugging #2737

Closed
hermanbanken opened this issue Apr 19, 2023 · 1 comment
Closed

Support trimpath when debugging #2737

hermanbanken opened this issue Apr 19, 2023 · 1 comment

Comments

@hermanbanken
Copy link

hermanbanken commented Apr 19, 2023

Is your feature request related to a problem? Please describe.
I spend a few days pulling my hair out why debugging was not working via "run test | debug test", while the launch configuration did work fine. Long story short, this was my settings.json:

  "go.testFlags": [
    "-trimpath",
    "-v"
  ],

This results in file paths like /Users/hermanbanken/repos/myrepo/foobar.go:42 be rewritten to github.com/hermanbanken/myrepo/foobar.go:42. This is nice for brevity, but breaks:

  1. File Links (clicking the link in the terminal and jumping to the exact line)
  2. Debugging via run test | debug test because breakpoints reference absolute paths, and those do not match what dlv reports.

Describe the solution you'd like
A combination of any of these options:

  • Warnings when -trimpath is used in testFlags settings
  • Support for module paths in VSCode File Links (is this this extension?)
  • Support for dlv paths being module paths (is this this extension?)

Describe alternatives you've considered
For now I removed -trimpath and my debugging flow works again.

Related to microsoft/vscode-go#1935.

@suzmue
Copy link
Contributor

suzmue commented Apr 20, 2023

I believe this is a duplicate of #1985. Please feel free to reopen if this is not the case.

@suzmue suzmue closed this as completed Apr 20, 2023
@golang golang locked and limited conversation to collaborators Apr 19, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants