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: no results for implementations #36219

Closed
DBreitigan opened this issue Dec 19, 2019 · 4 comments
Closed

x/tools/gopls: no results for implementations #36219

DBreitigan opened this issue Dec 19, 2019 · 4 comments
Labels
Milestone

Comments

@DBreitigan
Copy link

@DBreitigan DBreitigan commented Dec 19, 2019

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"
@gopherbot gopherbot added the gopls label Dec 19, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 19, 2019

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 stamblerre changed the title gopls: Find an interface's method implementations returns nothing x/tools/gopls: no results for implementations Dec 19, 2019
@gopherbot gopherbot added this to the Unreleased milestone Dec 19, 2019
@gopherbot gopherbot added the Tools label Dec 19, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 19, 2019

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 stamblerre modified the milestones: Unreleased, gopls v1.0 Dec 19, 2019
@DBreitigan

This comment has been minimized.

Copy link
Author

@DBreitigan DBreitigan commented Dec 19, 2019

@stamblerre Yes, you are correct. After updating to master, find implementation is properly working. Thanks for your help!

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 19, 2019

Great, thank you for confirming!

@stamblerre stamblerre closed this Dec 19, 2019
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.