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

x/tools/gopls: swallow hover errors #32967

Open
shackra opened this issue Jul 7, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@shackra
Copy link

commented Jul 7, 2019

Please answer these questions before submitting your issue. Thanks!

What did you do?

moved the cursor around in Emacs

What did you expect to see?

Nothing

What did you see instead?

Several errors like the following:

LSP :: no identifier found [19 times]

Build info

version v0.1.1, built in $GOPATH mode

Go info

go version go1.12.6 linux/amd64

GOARCH="amd64"
GOBIN="/home/jorge/go/bin"
GOCACHE="/home/jorge/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jorge/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build604366083=/tmp/go-build -gno-record-gcc-switches"

This was reported at emacs-lsp/lsp-mode and it was said that this is on the server's fault per LSP specification: emacs-lsp/lsp-mode#751 (comment)

@gopherbot gopherbot added this to the Unreleased milestone Jul 7, 2019

@gopherbot gopherbot added the gopls label Jul 7, 2019

@stamblerre stamblerre changed the title x/tools/gopls: Moving with the arrow keys in a Go project causes a lot of errors in Emacs x/tools/gopls: swallow hover errors Jul 8, 2019

@stamblerre stamblerre added the NeedsFix label Jul 8, 2019

@zclark

This comment has been minimized.

Copy link

commented Jul 17, 2019

It's particular annoying in emacs due to the way it makes emacs-lsp spam the echo area with the error, wiping out other useful messages.
I just patch it locally to make:
https://github.com/golang/tools/blob/dd7c7173f160f55e5c8583101f0e9ae2b7c4ce57/internal/lsp/hover.go#L31 -> return nil, nil
to silence this, as it seems hover should not be returning errors in this case, or at least the "no identifier found" case

@stamblerre

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

@zclark - feel free to contribute your package as a CL, if you're interested in doing so. I'm sorry that this issue hasn't been addressed yet, but you're totally right - that is the correct solution.

shackra added a commit to shackra/tools that referenced this issue Jul 21, 2019

@shackra

This comment has been minimized.

Copy link
Author

commented Jul 21, 2019

@stamblerre I made a pull request based on @zclark suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.