Skip to content

[Go Tests] Non-compilable code does not get its FilePath expanded #522

Closed
@oliverpool

Description

@oliverpool

What version of Go, VS Code & VS Code Go extension are you using?

  • go version go1.15 linux/amd64
  • code -v
1.47.2
17299e413d5590b14ab0340ea477cdd86ff13daf
x64
  • VS Code Go 0.16.1

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

  1. Create a go file which can't compile. main.go
package main

func main() {
	Hello{}
}
  1. Run the tests Go: Test package
  2. See Output:
Running tool: /usr/bin/go test -timeout 30s -coverprofile=/tmp/vscode-go1sM0GN/go-code-cover

# github.com/oliverpool/vscode-go-bugreport
./main.go:4:2: undefined: Hello

The ./main.go:4:2 is not expanded, hence not clickable.

  1. Create a test main_test.go
package main

func Test() {
	Hello{}
}
  1. Run the tests Go: Test package
  2. See Output:
Running tool: /usr/bin/go test -timeout 30s -coverprofile=/tmp/vscode-go1sM0GN/go-code-cover

# github.com/oliverpool/vscode-go-bugreport
/home/vscode-go-bugreport/main_test.go:3:1: wrong signature for Test, must be: func Test(t *testing.T)
FAIL	github.com/oliverpool/vscode-go-bugreport [setup failed]

/home/vscode-go-bugreport/main_test.go:3:1 is clickable (to quickly jump to the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions