Skip to content
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

GoTestCompile/GoTestFunc opens unexpected buffer when compile fails #2400

Closed
ldelossa opened this issue Jul 14, 2019 · 2 comments · Fixed by #2401
Closed

GoTestCompile/GoTestFunc opens unexpected buffer when compile fails #2400

ldelossa opened this issue Jul 14, 2019 · 2 comments · Fixed by #2401

Comments

@ldelossa
Copy link
Contributor

What did you do? (required: The issue will be closed when not provided)

Ran "GoTestCompile" and "GoTestFunc" on a test file with that has syntax errors.

What did you expect to happen?

Compilation errors are populated in quickfix menu (which does happen) and no new buffer is created.

What happened instead?

A new buffer is created just containing a "package x" line on the top. This buffer is named according to the file that is under test, but without any relative pathing. Screenshot below

Configuration (MUST fill this out):

https://github.com/ldelossa/dotfiles/blob/master/vimrc#L209-L278

vim-go version:

MASTER

vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do

https://github.com/ldelossa/dotfiles/blob/master/vimrc

Vim version (first three lines from :version):

NVIM v0.3.8
Build type: Release
LuaJIT 2.0.5

Go version (go version):

go version go1.12.1 darwin/amd64

Go environment

go env Output:
GOARCH="amd64"
GOBIN="/Users/louis/git/gopath/bin"
GOCACHE="/Users/louis/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/louis/git/gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/louis/git/go/libcscan/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mc/xwfdd41j1j74xfmcmphbwpgw0000gn/T/go-build106003689=/tmp/go-build -gno-record-gcc-switches -fno-common"

vim-go configuration:

vim-go configuration
g:go_list_type = 'quickfix'
g:go_highlight_operators = 1
g:go_jump_to_error = 1
g:go_term_enabled = 1
g:go_metalinter_deadline = '5s'
g:go_highlight_fields = 1
g:go_metalinter_command = 'golangci-lint'
g:go_def_mode = 'godef'
g:go_disable_autoinstall = 0
g:go_highlight_structs = 1
g:go_highlight_functions = 1
g:go_gotags_bin = 'gotags'
g:go_test_show_name = 1
g:go_test_timeout = '600s'
g:go_highlight_types = 1
g:go_fmt_command = 'goimports'
g:go_highlight_methods = 1
g:go_list_height = 10
g:go_fmt_experimental = 1
g:go_loaded_gosnippets = 1
g:go_term_height = 10
g:go_term_mode = 'split'
g:go_build_tags = 'integration'
g:go_highlight_build_constraints = 1
g:go_loaded_install = 1
g:go_decls_mode = 'fzf'

image
Screenshot after running "GotTestFunc" with a file that contains compilation error. Buffers are listed on the most bottom quickfix window. Current buffer is the one that is created unexpectedly and must be closed every time

@ldelossa
Copy link
Contributor Author

@bhcleek looks like this is also tied to either test.vim or term.vim - can't seem to pin point where the buffer is created but if I remove the go_term_enabled flag, issue goes away.

@ldelossa
Copy link
Contributor Author

Think I see what's going on. in term.vim the method s:on_exit wants to jump to the item in the quick fix menu, but I think that's a temporary file created for test compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant