extension/src/goTest: preserve buildFlags as array when debugging tests#4035
extension/src/goTest: preserve buildFlags as array when debugging tests#4035vrv501 wants to merge 1 commit into
Conversation
|
This PR (HEAD: 9f43132) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/vscode-go/+/781820. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from Vaibhav: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from Madeline Kalil: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-06-02T14:13:53Z","revision":"42c905443284a104e44d59dd8ab1e7341fa2d268"} Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from Madeline Kalil: Patch Set 2: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3771561>) Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: This CL has failed the run. Reason: Tryjob golang/try/x_vscode-go-go1.25-linux-amd64_docker has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
|
Message from Madeline Kalil: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/781820. |
The debugTestAtCursor CodeLens previously joined go.buildFlags into a
single space-separated string before passing them to the debug adapter.
This corrupted flag values that contain spaces, such as
-ldflags "-X pkg.version=v1.0": after joining, delve sees -X and
pkg.version=v1.0 as separate arguments and fails with "with multiple
packages, -o must refer to a directory or /dev/null".
Meanwhile, the run-test CodeLens passes each flag as a separate
argument to go test, so the same go.buildFlags worked for "run test"
but broke "debug test".
Fix:
Pass buildFlags as an array to startDebugging. The existing
maybeJoinFlags helper in goDebugConfiguration.ts already handles both
shapes: it joins for delve < 1.22.2 and preserves the array for newer
delve, so each element reaches delve as a separate token. Also omit
buildFlags from the debug config when empty to keep behavior parity
with the previous "" sentinel.
Fixes #3933