Closed
Description
Please answer these questions before submitting your issue. Thanks!
What did you do?
click install new go please when it popped up in vs code then restart vs code
What did you expect to see? auto completions tool tips
What did you see instead? no auto completions or tool tips
Build info
golang.org/x/tools/gopls v0.3.1
golang.org/x/tools/gopls@v0.3.1 h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/tools@v0.0.0-20200204151227-34c67990bfe7 h1:hWZVyLW37WdETuLIGQMvQIhMfXXAOANmAIEAluZMy3c=
golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
honnef.co/go/tools@v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
Go info
go version go1.13.4 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sfleeman/Library/Caches/go-build"
GOENV="/Users/sfleeman/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY="github.com/<redacted>"
GONOSUMDB="github.com/<redacted>"
GOOS="darwin"
GOPATH="/Users/<redacted>/go"
GOPRIVATE="github.com/RedVentures"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/<redacted>/go/src/github.com/<redacted>/<redacted>/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/24/sx13x65d1xd1mlpy_z33l_r88l7m4g/T/go-build773498168=/tmp/go-build -gno-record-gcc-switches -fno-common"
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
gopherbot commentedon Feb 7, 2020
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.
stamblerre commentedon Feb 7, 2020
Can you please share the output of
gopls -rpc.trace -v check path/to/file.go
?[-]x/tools/gopls: [/-][+]x/tools/gopls: not working[/+]sjf3 commentedon Feb 7, 2020
020/02/07 13:51:07 Info:2020/02/07 13:51:07 Build info
golang.org/x/tools/gopls v0.3.1
golang.org/x/tools/gopls@v0.3.1 h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/tools@v0.0.0-20200204151227-34c67990bfe7 h1:hWZVyLW37WdETuLIGQMvQIhMfXXAOANmAIEAluZMy3c=
golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
honnef.co/go/tools@v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
Go info
go version go1.13.4 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users//Library/Caches/go-build"
GOENV="/Users//Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY="github.com/"
GONOSUMDB="github.com/"
GOOS="darwin"
GOPATH="/Users//go"
GOPRIVATE="github.com/"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/24/sx13x65d1xd1mlpy_z33l_r88l7m4g/T/go-build054596692=/tmp/go-build -gno-record-gcc-switches -fno-common"
2020/02/07 13:51:08 Info:2020/02/07 13:51:08 go/packages.Load
snapshot = 0
query = [./... builtin]
packages = 2
stamblerre commentedon Feb 7, 2020
Thanks! Looks like
gopls
is able to type-check your package fine. Can you share the logs from when completion or hover fail? Information on how to capture logs is here: https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs. Make sure to add the-rpc.trace
flag in your settings so that there is more detailed output.sjf3 commentedon Feb 7, 2020
Trace - 13:57:56.872 PM] Sending notification '$/cancelRequest'.
Params: {"id":17}
[Trace - 13:57:56.873 PM] Received response 'textDocument/hover - (17)' in 51ms.
Result: {}
2020/02/07 13:57:56 : context canceled
[Trace - 13:57:56.874 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/02/07 13:57:56 : context canceled"}
[Error - 1:57:56 PM] 2020/02/07 13:57:56 : context canceled
[Trace - 13:57:57.022 PM] Sending request 'textDocument/hover - (18)'.
Params: {"textDocument":{"uri":"file:///Users//go/src/github.com//internal/service/service.go"},"position":{"line":1243,"character":33}}
[Trace - 13:57:57.986 PM] Received response 'textDocument/hover - (18)' in 964ms.
Result: {}
[Trace - 13:57:57.986 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/02/07 13:57:57 go/packages.Load\n\tsnapshot = 1\n\tquery = [file=/Users//internal/service/service.go]\n\tpackages = 0"}
[Info - 1:57:57 PM] 2020/02/07 13:57:57 go/packages.Load
snapshot = 1
query = [file=/Users//go/src/github.com///internal/service/service.go]
packages = 0
sjf3 commentedon Feb 10, 2020
I figured it out. Stray character in the go.mod file makes gopls angry even though everything is vendored