x/tools/gopls: gopls Extracts declarations to new file when a liveshare guest puts a cursor on a function name #71314
Description
gopls version
0.17.0
go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\MnHs\AppData\Local\go-build
set GOENV=C:\Users\MnHs\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\MnHs\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\MnHs\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\MnHs\go\pkg\mod\golang.org\t[email protected]
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Users\MnHs\go\pkg\mod\golang.org\t[email protected]\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.22.5
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=D:\Files\Dev\Go\hybroid\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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\MnHs\AppData\Local\Temp\go-build2618848323=/tmp/go-build -gno-record-gcc-switches
What did you do?
click on a function name as a guest in a liveshare session
What did you see happen?
function getting extracted into its own file
20250117-1739-26.9775796.mp4
What did you expect to see?
nothing
Editor and settings
No response
Logs
[Error - 7:57:53 PM] Request codeAction/resolve failed.
Message: unable to resolve code action "Extract declarations to new file"
Code: 0
[Error - 7:57:53 PM] Request codeAction/resolve failed.
Message: package has type errors: D:\Files\Dev\Go\hybroid\parser\expressions.go:41:38: first argument to append must be a slice; have p.Context.FunctionReturns (variable of type Stack[int])
Code: 0
[Info - 7:57:53 PM] 2025/01/17 19:57:53 go/packages.Load #91
view_id="1"
snapshot=109
directory=D:\Files\Dev\Go\hybroid
query=[file=D:\Files\Dev\Go\hybroid\parser\fn.go]
packages=1
duration=524.9546ms
[Info - 7:57:53 PM] 2025/01/17 19:57:53 go/packages.Load #92
view_id="1"
snapshot=109
directory=D:\Files\Dev\Go\hybroid
query=[file=D:\Files\Dev\Go\hybroid\parser\expressions.go]
packages=1
duration=520.1642ms
[Info - 7:57:55 PM] 2025/01/17 19:57:55 go/packages.Load #93
view_id="1"
snapshot=110
directory=D:\Files\Dev\Go\hybroid
query=[hybroid hybroid/cli hybroid/cli/commands hybroid/evaluator hybroid/walker/pass2]
packages=7
duration=522.4333ms