-
Notifications
You must be signed in to change notification settings - Fork 763
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
[Go Tests] Non-compilable code does not get its FilePath expanded #522
Comments
When I run To fix this issue:
|
NB: sometime the failing output does not have a column value ( I can't reproduce it on a small example, but here is the output of my CLI:
So this is more likely a |
Please let me know, if you think that this issues should be reported (and fixed) directly in the |
@oliverpool thanks for reporting the issue. In my opinion, diagnostics feature is a more reliable way to surface compilation/build errors than the failure messages from the test output. For example, if you use the language server( |
Change https://golang.org/cl/248737 mentions this issue: |
@oliverpool cl/248737 fixes the file location expansion issue when handling the build error output. |
This look good, thanks! Using a regex is brittle, but the proposed
It does not match filenames with a space, but they always bear ambiguity:
|
Change https://golang.org/cl/252118 mentions this issue: |
…pansion Build error output format can be different from the test output format. Adjust the regex change in expandFilePathInOutput so it can capture build errors that contain column numbers as well while capturing the file path from test outputs such as ``` TestB: b_test.go:6: test failed ``` The above line was incorrectly expanded in pre v0.16.0 pre v0.16.0: /^\s*(.+.go):(\d+):/ v0.16.0, v0.16.1: /\s+(\S+.go):(\d+):\s+/ this CL: /\s*(\S+\.go):(\d+):/ Fixes #522 Change-Id: Ifa8f07d3bb7c5aaa61d40dd29d9fae77d8ad0cbe Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/248737 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> (cherry picked from commit 1e4dbe2) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/252118 TryBot-Result: kokoro <[email protected]>
What version of Go, VS Code & VS Code Go extension are you using?
go version go1.15 linux/amd64
code -v
Share the Go related settings you have added/edited
"go.useLanguageServer": true,
Describe the bug
When I run a test against a source which is not compilable (undefined struct), the location of the compilation error is not expanded to the fullpath of the code (and is hence not clickable).
Steps to reproduce the behavior:
Repo to reproduce: https://github.com/oliverpool/vscode-go-bugreport
main.go
Go: Test package
The
./main.go:4:2
is not expanded, hence not clickable.main_test.go
Go: Test package
/home/vscode-go-bugreport/main_test.go:3:1 is clickable (to quickly jump to the issue
The text was updated successfully, but these errors were encountered: