Closed ldelossa closed 4 years ago
I suspect the right thing to do here is to move https://github.com/fatih/vim-go/blob/d2e82b50a822ee2dcfb51aef266d28ce433d4bc9/autoload/go/term.vim#L204 above https://github.com/fatih/vim-go/blob/d2e82b50a822ee2dcfb51aef266d28ce433d4bc9/autoload/go/term.vim#L201
edit: update links to permalinks (master has changed since the original draft)
will test.
@ldelossa did you have a chance to try out my suggestion?
@ldelossa I've tried to duplicate what you've described without success.
Here's a script that I created to try to duplicate:
#!/bin/sh
mkdir 2806
cd 2806
go mod init github.com/bhcleek/2806
cat <<EOF > main_test.go
package main
import (
"github.com/bhcleek/2806/subdir"
"testing"
)
func TestHelloWorld(t *testing.T) {
subdir.Foo()
t.Fatal("not implemented")
}
EOF
mkdir subdir
cat <<EOF > subdir/subdir.go
package subdir
import "fmt"
func Foo() {
fmt.Println("vim-go"
}
EOF
vim -c 'let g:go_term_enabled=1' -c :GoTest main_test.go
@bhcleek sorry was a bit MIA for a little. I can't seem to reproduce this. So I am going to close.
What did you do? (required: The issue will be closed when not provided)
Ran a terminal driven command such as GoTest.
What did you expect to happen?
The test to fail and jump to a file where the issue exists
What happened instead?
When the file which causes an error is in another library or the stdlib, the path to the source file cannot be determined and an empty buffer is created
Removing ths line fixes the issue: https://github.com/fatih/vim-go/blob/d2e82b50a822ee2dcfb51aef266d28ce433d4bc9/autoload/go/term.vim#L201
I am not sure however if this is the "right" thing to do. Ideally you could jump to the location in a imported package's file and see where the error existed that failed the test.
You can reproduce this issue by importing a package, alterting that package to produce a test failure case, and running GoTest in terminal mode (vim8 or nvim, shouldn't matter)
Configuration (MUST fill this out):
vim-go version:
vimrc
you used to reproduce:vimrc
Vim version (first three lines from
:version
):VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 18 2020 14:57:56) Included patches: 1-401 Compiled by louis@localhost.localdomain
Go version (
go version
):go version go1.14 linux/amd64
Go environment
go env
Output:gopls version
gopls version
Output:vim-go configuration:
vim-go configuration
filetype detection configuration:
filetype detection