Skip to content

x/tools/gopls: references doesn't work properly. #60676

Closed
@pavlelee

Description

@pavlelee

gopls version

Build info

golang.org/x/tools/gopls master
golang.org/x/tools/gopls@(devel)
github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/[email protected] h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/[email protected] h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
golang.org/x/[email protected] h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/[email protected] h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/[email protected] h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/[email protected] h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/tools@(devel)
golang.org/x/[email protected] h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=
honnef.co/go/[email protected] h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc=
mvdan.cc/[email protected] h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.4

go env

GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/data/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/data/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/data/go"
GOPRIVATE=""
GOPROXY=""
GOROOT="/usr/local/go"
GOSUMDB=""
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/data/go/src/dashboard/go.mod"
GOWORK="/data/go/src/dashboard/go.work"
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 -fdebug-prefix-map=/tmp/go-build3198834238=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go work file:

go 1.20

use (
	.
	./staging/src/skipper
)

Correct:

gopls references -d /data/go/src/dashboard/staging/src/skipper/pkg/models/vm.go:130:2
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:255:15-23
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:257:13-21
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:263:12-20
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:263:236-244
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:282:12-20
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:282:207-215
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:297:14-22
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:298:12-20
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:305:11-19
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:305:206-214
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:523:11-19
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:523:206-214
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:531:11-19
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:531:206-214
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:560:11-19
/data/go/src/dashboard/cmd/nightsWatch/tools/initNode.go:560:206-214
/data/go/src/dashboard/dao/vminstance.go:614:3-11
/data/go/src/dashboard/service/progress.go:498:20-28
/data/go/src/dashboard/service/progress.go:504:49-57
/data/go/src/dashboard/staging/src/skipper/pkg/models/vm.go:130:2-10

The second time, wrong:

gopls references -d /data/go/src/dashboard/staging/src/skipper/pkg/models/vm.go:130:2
/data/go/src/dashboard/dao/vminstance.go:614:3-11
/data/go/src/dashboard/staging/src/skipper/pkg/models/vm.go:130:2-10

If I execute rm-rf / root/.cache/ gopls, I can restore the correct results

What did you expect to see?

What did you see instead?

Editor and settings

Logs

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions