-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug: vscode fails to run the project if tab with name like "_test" is active #1422
Comments
Thanks for reporting the issue. @schroding3rscat cc/ @suzmue @polinasok |
|
Agree it's confusing. Looking into the history, the '"auto"' mode was originated from microsoft/vscode-go#1780 and it seems that the intention was to switch the mode between 'test' and 'debug' based on the open file. How about adjusting the logic like the following?
Stretch - if the open file is not in a |
Sounds reasonable, will be great. |
Change https://golang.org/cl/316509 mentions this issue: |
If the `program` attribute is a go file, then we can use this to determine whether to run 'debug' or 'test'. If the program for 'test' mode is a test file, we run it instead in the package. Updates #1422 Change-Id: I869b0cb7422634d74dee5a04f6cc131be17ddc2f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/316509 Trust: Suzy Mueller <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
If the `program` attribute is a go file, then we can use this to determine whether to run 'debug' or 'test'. If the program for 'test' mode is a test file, we run it instead in the package. Updates golang#1422 Change-Id: I869b0cb7422634d74dee5a04f6cc131be17ddc2f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/316509 Trust: Suzy Mueller <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
This was released in v0.25.0. Closing. Thanks @suzmue |
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.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.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Describe the bug
I configure all my projects to run from
${workspaceFolder}/cmd
. Everything is OK until I try to press F5 when I have any*_test.go
file as an active tab. When I do this, I see this error in the output:This issue won't reproduce when I set any other non-test file as active tab.
My
launch.json
:Steps to reproduce the behavior:
Screenshots or recordings
The text was updated successfully, but these errors were encountered: