x/tools/gopls: hover link is incorrect for embedded struct #40294
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.
Milestone
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogo version go1.14.3 darwin/amd64
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders1.47.2
v0.15.1
go env
to get the go development environment detailsGO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/marc/Library/Caches/go-build"
GOENV="/Users/marc/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/marc/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/1q/jpdtk_3x6b53cjtmt4rxccsh0000gn/T/go-build578823030=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
None.
Describe the bug
Wrong type description in popover that leads to wrong/non-existent section of the docs
Steps to reproduce the behavior:
It will display a popover that includes the following link to docs:
(mux.MyHandler).HandleFuncon pkg.go.dev
As you can see, MyHandler is a struct in which *mux.Router is embedded. I don't get what (mux.MyHanlder) means and when you click on the link on the popover it goes to the top of the mux package documentation page, since there is no section called MyHandler.
If instead of h.HandleFunc I use h.Router.HandleFunc then everything is fine and the link displayed by VSCode will say (mux.Router).Handlefunc and when I click it I end up on the Router section of the mux package documentation.
The actual code I'm using is a little different (see below) but it annoys me that 1) the type reported by VSCode in the case of h.HandleFunc makes NO SENSE (what does "(mux.MyHandler)" even mean given that I'm just embedding mux.Router in MyHandler struct) and it's certainly showing buggy behavior by linking to a non-existing section of the package doc (mux.MyHandler).HandleFunc instead of (mux.Router).HandleFunc ...
Screenshots or recordings
The text was updated successfully, but these errors were encountered: