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: use xerrors package #31374

Open
bstaletic opened this issue Apr 9, 2019 · 5 comments

Comments

Projects
None yet
6 participants
@bstaletic
Copy link

commented Apr 9, 2019

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

$ go version
go version go1.12.1 linux/amd64

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
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/bstaletic/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bstaletic/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-build434682588=/tmp/go-build -gno-record-gcc-switches"

What did you do?

This is basically a continuation of #31194. This time I'm having troubles getting to gopls' log.

Steps to reproduce:

  • Follow all but the final two steps in #31194 (basically, setup ycmd and open a go file).
  • Currently, the gopls command line is gopls -logfile /tmp/gopls_$PID_$RANDOM.log
    • The file and its name is generated by ycmd.
  • If the log path is hardcoded (to somthing like /home/bstaletic/go.log), the empty log file gets created but nothing is written to the file.

What did you expect to see?

Some content in the log, to help me debug things.

What did you see instead?

Empty log whose size was 0bytes.

@ianthehat

This comment has been minimized.

Copy link

commented Apr 10, 2019

try adding -rpc.trace and it will log all the rpc messages

@ianthehat ianthehat added the gopls label Apr 10, 2019

@bstaletic

This comment has been minimized.

Copy link
Author

commented Apr 10, 2019

Thanks. That did work. Is there also a way to log tracebacks when an error is returned?

@bcmills bcmills changed the title gopls doesn't write its log x/tools/cmd/gopls: doesn't write its log Apr 10, 2019

@gopherbot gopherbot added this to the Unreleased milestone Apr 10, 2019

@stamblerre

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

Not right now, but we should switch to using the https://golang.org/x/xerrors package so that we can do that.

@stamblerre stamblerre changed the title x/tools/cmd/gopls: doesn't write its log x/tools/internal/lsp: use xerrors May 21, 2019

@bstaletic

This comment has been minimized.

Copy link
Author

commented May 21, 2019

Thanks for the response. For what it's worth, I did make a PR for our project to use gopls instead of gocode and godef.

ycm-core/ycmd#1243

@stamblerre stamblerre changed the title x/tools/internal/lsp: use xerrors x/tools/internal/lsp: use xerrors package Jun 5, 2019

@jan-xyz

This comment has been minimized.

Copy link

commented Jun 6, 2019

I would like to take on this issue, what's the best way to start?

@stamblerre stamblerre changed the title x/tools/internal/lsp: use xerrors package x/tools/gopls: use xerrors package Jul 2, 2019

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.