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

GoInfo not working and always calls 'guru' instead of 'gopls' #2308

Closed
cnbuff410 opened this issue May 24, 2019 · 7 comments
Closed

GoInfo not working and always calls 'guru' instead of 'gopls' #2308

cnbuff410 opened this issue May 24, 2019 · 7 comments

Comments

@cnbuff410
Copy link

cnbuff410 commented May 24, 2019

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

Run "GoInfo" in the vim

What did you expect to happen?

When I use GoInfo, vim-go uses gopls instead of guru to show the information of the method my cursor is on.

What happened instead?

There is no info showing. And vim-go calls guru instead of gopls.

I used let g:go_debug=['shell-commands'], and then check the messages every time I tried to run 'GoInfo', every time the message I saw is

vim-go: job command: ['/Users/kunli/Work/golang//bin/guru', '-tags', '', '-json', 'what', '/Users/kunli/Work/golang/src/github.com/stryd/cloud/backend/handler_activity.go:#39399']

Even though I set the go_info_mode to be gopls.

Configuration (MUST fill this out):

let g:go_fmt_command = 'goimports' " vim-go
let g:go_def_mode = 'gopls' " vim-go
let g:go_auto_sameids = 1 " vim-go
let g:go_info_mode = 'gopls' " vim-go
let g:go_auto_type_info = 1 " vim-go
set updatetime=200 " Used for sameids and type_info from go-vim

vim-go version:

Latest

Vim version (first three lines from :version):

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 19 2019 12:07:03)
macOS version
Included patches: 1-950

Go version (go version):

go version go1.12.4 darwin/amd64

Go environment

go env Output:
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kunli/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kunli/Work/golang/"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/_z/_bqq6dy121vcf1m31f2749l80000gn/T/go-build609216554=/tmp/go-build -gno-record-gcc-switches -fno-common"

@bhcleek
Copy link
Collaborator

bhcleek commented May 25, 2019

I'm not sure why you're seeing guru be used. g:go_info_mode controls which binary is used to get info: https://github.com/fatih/vim-go/blob/master/autoload/go/tool.vim#L89-L90

But it looks like gopls recently changed the responses of the requests that vim-go uses for :GoInfo. I'll update vim-go's parsing of the responses soon.

edit: remove incorrect information

@bhcleek
Copy link
Collaborator

bhcleek commented May 26, 2019

Does #2311 resolve this for you?

@cnbuff410
Copy link
Author

Not really. I see what you mean now, so the issue is that the message is showing as multiline but my info window is only one line tall, correct? I did the bundle update but I'm still not seeing the info.

@bhcleek
Copy link
Collaborator

bhcleek commented May 26, 2019

Did you update to the PR I linked, or did you just update to latest master?

@cnbuff410
Copy link
Author

I think I only updated to the latest master. How can I update to this specific PR? I use the Vundle.

@bhcleek
Copy link
Collaborator

bhcleek commented May 26, 2019

I assume the vundle docs explain it.

@cnbuff410
Copy link
Author

I can confirm that it fixes this problem. Thanks!

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

No branches or pull requests

2 participants