x/tools/gopls: no results for implementations
Closed this issue · 4 comments
What did you do?
when trying to run "find implementation" of fooInterface's method test(int) int, It give me an error "no implementation found".
package main
import (
"fmt"
)
type fooInterface interface {
test(int) int
}
type fooStruct struct {
}
func main() {
f := fooStruct{}
fmt.Println(f.test(5))
fmt.Println("Hello, playground")
}
func (f fooStruct) test(i int) int {
return i
}
What did you expect to see?
I expect to be taken to implementations of test(int) int, in this case, fooStruct's implementation
What did you see instead?
An error:
[Error - 9:01:34 AM] Request textDocument/implementation failed.
Message: no type info object for identifier
Code: 0
Build info
golang.org/x/tools/gopls 0.2.2
golang.org/x/tools/gopls@v0.2.2 h1:ujGisyytgY1VGcmd66wIJ9+wVAfmodXj6daHM43HRXk=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/tools@v0.0.0-20191206201009-952e2c076240 h1:metzFnqcC0vUPmZX4El8bICiQU9hieZ3L9dXAitxVXQ=
golang.org/x/xerrors@v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
honnef.co/go/tools@v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
Go info
go version go1.13 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/dbreitigan/go/bin"
GOCACHE="/Users/dbreitigan/Library/Caches/go-build"
GOENV="/Users/dbreitigan/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY="github.com/sendgrid"
GONOSUMDB="github.com/sendgrid"
GOOS="darwin"
GOPATH="/Users/dbreitigan/go"
GOPRIVATE="github.com/sendgrid"
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/dbreitigan/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/bq/mj22kv3d3933j2tqsl4c5z600000gp/T/go-build005566294=/tmp/go-build -gno-record-gcc-switches -fno-common"
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.
I believe that the support for implementations is incomplete in gopls v0.2.2. The next tagged version will have improved support.
Can you try reproducing the issue at master? You can download master by running GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master.
@stamblerre Yes, you are correct. After updating to master, find implementation is properly working. Thanks for your help!
Great, thank you for confirming!