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

gopls - cannot find implementations of methods on generic types #70676

Closed
msvitok77 opened this issue Dec 4, 2024 · 2 comments
Closed

gopls - cannot find implementations of methods on generic types #70676

msvitok77 opened this issue Dec 4, 2024 · 2 comments
Labels
gopls Issues related to the Go language server, gopls.

Comments

@msvitok77
Copy link

Go version

go version go1.22.8 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/md138/.cache/go-build'
GOENV='/home/md138/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/md138/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/md138/go'
GOPRIVATE=''
GOPROXY=
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.8'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/md138/gp/zmazma/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2179200752=/tmp/go-build -gno-record-gcc-switches'

What did you do?

package main

import "context"

type EventSender[T any] interface {
	Send(ctx context.Context, message T) error
	Close(ctx context.Context) error
}

type Producer[T any] struct{}

func (p *Producer[T]) Close(ctx context.Context) error {
	return nil
}

func (p *Producer[T]) Send(ctx context.Context, message T) error {
	return nil
}

func main() {
}

Go to Send method (in neovim, vscode) and try to find implementations.

What did you see happen?

No LSP Implementations found.

What did you expect to see?

cursor jumps to line 16 where we have an implementation of Send method.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Dec 4, 2024
@adonovan
Copy link
Member

adonovan commented Dec 4, 2024

Dup of #59224, but I agree this needs to get fixed.

@adonovan adonovan closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

4 participants