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

Closed
shackra opened this issue Jul 7, 2019 · 4 comments
Closed

x/tools/gopls: swallow hover errors #32967

shackra opened this issue Jul 7, 2019 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@shackra
Copy link

shackra 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 Issues related to the Go language server, 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 The path to resolution is known, but the work has not been done. label Jul 8, 2019
@stamblerre stamblerre added the Suggested Issues that may be good for new contributors looking for work to do. label Jul 16, 2019
@zclark
Copy link

zclark 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
Copy link
Contributor

@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
Copy link
Author

shackra commented Jul 21, 2019

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

@gopherbot
Copy link

Change https://golang.org/cl/186997 mentions this issue: internal/lsp: swallow hover error over identifier not found

@golang golang locked and limited conversation to collaborators Jul 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants