x/tools/gopls: Autocompletion sometimes jumps to wrong location. #58960
Labels
FrozenDueToAge
gopls/file-corruption
Issues related to file corruption in gopls
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Translated from Google:
gopls version
v0.11.0
go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=D:\Program Files\Go\bin
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOENV=C:\Users\Administrator\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\Project\GO\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\Project\GO
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=E:\Project\GO\Demo\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build732281470=/tmp/go-build -gno-record-gcc-switches
What did you do?
Automatically import packages.
This works fine in general.
What did you expect to see?
No unexpected problems.
What did you see instead?
Autocompletion sometimes jumps to wrong location.
Here is an example in vscode:
Editor and settings
editor: VSCode-win32-x64-1.76.1
Golang related config in my vscode:
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.formatOnSave": false,
},
"go.useLanguageServer": true,
"go.languageServerFlags": [
"-rpc.trace",
"-logfile",
"serve",
"--debug=localhost:6060",
],
Logs
This is the log:
log.txt
The text was updated successfully, but these errors were encountered: