Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

delve is not looked for in go.toolsGopath #2099

Closed
segevfiner opened this issue Nov 5, 2018 · 3 comments
Closed

delve is not looked for in go.toolsGopath #2099

segevfiner opened this issue Nov 5, 2018 · 3 comments

Comments

@segevfiner
Copy link
Contributor

This code: src/debugAdapter/goDebug.ts:361 only looks in GOPATH. It will fail to find dlv when it was installed in go.toolsGopath. (There is also GOBIN, but I'm not sure we are looking for tools there anywhere in the extension anyhow).

Steps to Reproduce:

  1. Set go.toolsGopath to a non-default value.
  2. Try to debug a go program using delve.
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 5, 2018

This is because the debug adapter runs in a separate process and doesnt have access to VS Code settings.

This can be fixed by sending the path to the delve tool as part of the debug configuration in the resolveDebugConfiguration method in the goDebugConfiguration.ts file.

PRs are most welcome to fix this.
Code Pointers:

  • Build and Debug extension
  • Update resolveDebugConfiguration in goDebugConfiguration.ts file to return a new property called dlvToolPath. Use getBinPath to fetch the path to dlv tool.
  • Debug the debugger
  • Update the goDebug.ts file to use the path to delve tool send as part of the debug configuration

segevfiner added a commit to segevfiner/vscode-go that referenced this issue Nov 8, 2018
ramya-rao-a pushed a commit that referenced this issue Nov 13, 2018
* Search for dlv in go.toolsGopath too

Fixes #2099

* Fix review comments
@virtuald
Copy link

Looking forward to a release with this fix!

@ramya-rao-a
Copy link
Contributor

The fix for this is now available in the latest version of the Go extension (0.8.0)
Thanks @segevfiner!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants