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: cannot find implementation for a particular interface in a vendored module #46894

Closed
ronakg opened this issue Jun 23, 2021 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ronakg
Copy link

ronakg commented Jun 23, 2021

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

$ go version
go version go1.16.5 darwin/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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rogandhi/Library/Caches/go-build"
GOENV="/Users/rogandhi/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/rogandhi/go/pkg/mod"
GONOPROXY="*.cisco.com"
GONOSUMDB="*.cisco.com"
GOOS="darwin"
GOPATH="/Users/rogandhi/go"
GOPRIVATE="*.cisco.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.5/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/rogandhi/work/ise-go/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f1/d20cq36s6gn1kj0vgdv855t00000gn/T/go-build226289176=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Some vendored modules are not getting parsed properly by gopls. Things like references, implementations etc for certain types don't work.

I've tried to navigate to references and implementations for these modules in both VSCode and Vim, but get the same results. I'm not able to reproduce the issue in a small project that I can post here for easy investigation. But I can provide any logs etc. as long as they don't reveal anything about the code itself.

The exact same issue is observed if I open just the vendored module in VSCode too.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 23, 2021
@seankhliao seankhliao changed the title gopls cannot find implementation for a particular interface in a vendored module x/tools/gopls: cannot find implementation for a particular interface in a vendored module Jun 23, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jun 23, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 23, 2021
@suzmue
Copy link
Contributor

suzmue commented Jun 24, 2021

Thanks for filing an issue @ronakg!

What happens when you try to navigate to references? In what way is it not working?

Could you please include the gopls logs for trying to navigate to references, and the version of gopls? Instructions for collecting gopls logs in VS Code can be found here.

@suzmue suzmue added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 24, 2021
@suzmue suzmue modified the milestones: Unreleased, gopls/unplanned Jun 24, 2021
@ronakg
Copy link
Author

ronakg commented Jun 24, 2021

What happens when you try to navigate to references? In what way is it not working?

When I try to get implementations for an interface, I don't get back any results. I don't get autocompletion results for some of such types as well. If I clone the vendored module separately in a different workspace, then everything works fine.

Attaching gopls server output -
gopls.log

@stamblerre
Copy link
Contributor

Ah, this is actually working as intended (for now). #42527 tracks adding support for vendor directories, but I'm not yet sure how we will solve this issue. For now, we don't treat vendored packages as "workspace packages", which prevents workspace-wide features (like implementations) from working in vendor directories.

I will close this in favor of #42527.

@stamblerre stamblerre removed this from the gopls/unplanned milestone Jun 28, 2021
@stamblerre stamblerre removed their assignment Jun 28, 2021
@golang golang locked and limited conversation to collaborators Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants