You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I moved version info after as it doesn't seem relevant)
Describe the bug
workspaceFolder is expanded to different values during the same run depending on where it is used.
Having the variable in both program and cwd doesn't always result in the same value. I took a quick look at the code of this plugin and workspaceFolder is expanded if it is in cwd during resolveDebugConfiguration: goDebugConfiguration.ts#L171. The comments above mention expanding ~, but resolvePath also expands workspaceFolder (see util.ts#L641).
I believe the call to resolvePath should be replaced with resolveHomeDir so that VS does the worspaceFolder expansion on its own which would ensure consistency.
Steps to reproduce the behavior:
This is a rough description of a setup that triggers the bug:
Create a workspace for a go package
Add a folder to the workspace which is separate from the go package dir
Create a debug config in launch.json where program and cwd contain ${workspaceFolder}
Set go.alternateTools: dlv in extension settings to the path of a script containing the following:
#!/bin/sh
echo pwd "$(pwd)"
echo dlv "$@"
When launching the debug session, you should see that pwd (expanded from program) and the --wd arg passed to dlv (expanded from cwd) didn't use the same workspaceFolder value.
What version of Go, VS Code & VS Code Go extension are you using?
Run go version to get version of Go from the VS Code integrated terminal.
go version go1.16.2 linux/amd64
Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
(I moved version info after as it doesn't seem relevant)
Describe the bug
workspaceFolder
is expanded to different values during the same run depending on where it is used.Having the variable in both
program
andcwd
doesn't always result in the same value. I took a quick look at the code of this plugin andworkspaceFolder
is expanded if it is incwd
duringresolveDebugConfiguration
: goDebugConfiguration.ts#L171. The comments above mention expanding~
, butresolvePath
also expandsworkspaceFolder
(see util.ts#L641).I believe the call to
resolvePath
should be replaced withresolveHomeDir
so that VS does theworspaceFolder
expansion on its own which would ensure consistency.Steps to reproduce the behavior:
This is a rough description of a setup that triggers the bug:
program
andcwd
contain${workspaceFolder}
go.alternateTools: dlv
in extension settings to the path of a script containing the following:When launching the debug session, you should see that
pwd
(expanded fromprogram
) and the--wd
arg passed to dlv (expanded fromcwd
) didn't use the sameworkspaceFolder
value.What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Go from the VS Code integrated terminal.go version go1.16.2 linux/amd64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.0.24.2
The text was updated successfully, but these errors were encountered: