What version of Go are you using (go version)?
$ go version
go version go1.20.2 linux/arm64
$ go list -m golang.org/x/tools
golang.org/x/tools v0.9.0
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.0.0-20230508221120-0809ec2e45f6
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="on"
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/myitcv/gostuff/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/gostuff/src/github.com/myitcv/govim/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 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2292349384=/tmp/go-build -gno-record-gcc-switches"
What did you do?
With the following input file:
package main
import (
"fmt"
"log"
)
type outer struct {
// outer logger
logger *log.Logger
inner
}
type inner struct {
// inner logger
logger *log.Logger
}
func main() {
var v outer
fmt.Println(v.lo_)
}
The cursor at the position _.
Attempt a completion.
What did you expect to see?
The single candidate outer.logger.
What did you see instead?
Two candidates:
outer.logger
inner.logger
The completion text for both is the plain logger. So this can't be correct, as the outer.logger shadows the embedded inner.logger.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
With the following input file:
The cursor at the position
_.Attempt a completion.
What did you expect to see?
The single candidate
outer.logger.What did you see instead?
Two candidates:
The completion text for both is the plain
logger. So this can't be correct, as theouter.loggershadows the embeddedinner.logger.