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/cmd/gopls: error returned by client Configuration simply logged #33645

Closed
myitcv opened this issue Aug 14, 2019 · 2 comments
Closed

x/tools/cmd/gopls: error returned by client Configuration simply logged #33645

myitcv opened this issue Aug 14, 2019 · 2 comments

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented Aug 14, 2019

What version of Go are you using (go version)?

$ go version
go version devel +61bb56ad63 Mon Aug 12 23:12:29 2019 +0000 linux/amd64
$ go list -m golang.org/x/tools
golang.org/x/tools v0.0.0-20190809145639-6d4652c779c4
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.4-0.20190809145639-6d4652c779c4

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/gostuff/src/github.com/myitcv/govim/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-build024756293=/tmp/go-build -gno-record-gcc-switches"

What did you do?

One of the issues I encountered whilst debugging #33347 is that an error return from a server call to the client's Configuration method ends up simply being logged.

[Trace - 12:09:37 PM] Sending response 'workspace/configuration - (2)' in 0ms.
Params: {}


[Error - 12:09:37 PM] send workspace/configuration oh dear


[Trace - 12:09:37 PM] Sending notification 'initialized' in 1ms.
Params: {}


[Trace - 12:09:37 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":1,"message":": oh dear"}

This feels like a serious enough error for us to want to surface it to the user?

Is the right way to do this for the server to call ShowMessage instead of LogMessage?


cc @stamblerre @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Aug 14, 2019
@gopherbot gopherbot added the Tools label Sep 12, 2019
@stamblerre stamblerre modified the milestones: Unreleased, gopls v1.0 Dec 4, 2019
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Dec 4, 2019

I think that we have started to report errors a bit better since this was filed (see https://github.com/golang/tools/blob/b1451cf3445bfc43d9982a3e85bec2dacced42ce/internal/lsp/general.go#L187). Is this still an issue for you, @myitcv?

@myitcv
Copy link
Member Author

@myitcv myitcv commented Dec 5, 2019

Yes, it is better handled now, thanks. Errors get reported back via ShowMessage which is exactly what I would hope/expect as the user.

@myitcv myitcv closed this Dec 5, 2019
@stamblerre stamblerre modified the milestones: gopls/v1.0.0, gopls/v0.4.0 Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.