Vim-go: Vim error in hoverHandler when open go file with active module support

Created on 7 Aug 2019  路  4Comments  路  Source: fatih/vim-go

When I open a go file with activated modules I get the following error in VIM.

2019-08-07_1151x364

Whenever I change to another line in the code I get the error again

The error comes from vim-go and points to here: https://github.com/fatih/vim-go/blob/master/autoload/go/lsp.vim#L594

Why do I get the error and how can I fix the problem? Thanks!

Configuration (MUST fill this out):

vim-go version:

1.20

Vim version (first three lines from :version):

8.1.1635

Go version (go version):

1.12.5

Go environment

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jan/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jan/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/jan/Projects/mymusic/mp3db/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build260878572=/tmp/go-build -gno-record-gcc-switches"

Most helpful comment

I'm still seeing this with latest vim-go and gopls. When I enable let g:go_auto_type_info = 1 and hover the cursor on import statements, such errors show up.

import (
    "net/http"
)

All 4 comments

gopls and vim-go have each changed quite a bit since vim-go v1.20. vim-go's master is pretty stable right now; I recommend upgrading to vim-go's master, running :GoUpdateBinaries gopls, restart vim afterwards and see if you still have problems.

I just updated yesterday all of my Vim-Plugins and also executed :GoInstallBinaries. But today I tried your tip with :GoUpdateBinaries gopls and it helped! Thank you very much!

I'm still seeing this with latest vim-go and gopls. When I enable let g:go_auto_type_info = 1 and hover the cursor on import statements, such errors show up.

import (
    "net/http"
)

I'm still seeing this with latest vim-go and gopls. When I enable let g:go_auto_type_info = 1 and hover the cursor on import statements, such errors show up.

import (
  "net/http"
)

I just started running into this too, after recently updating gopls.

To be fair, the gopls utility is rapidly changing, so it might just be a new error condition for it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

korjavin picture korjavin  路  4Comments

johnzeng picture johnzeng  路  3Comments

joeblubaugh picture joeblubaugh  路  3Comments

derekchiang picture derekchiang  路  3Comments

Michael-F-Ellis picture Michael-F-Ellis  路  3Comments