Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: gopls Extracts declarations to new file when a liveshare guest puts a cursor on a function name #71314

Open
RanPix opened this issue Jan 17, 2025 · 1 comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@RanPix
Copy link

RanPix commented Jan 17, 2025

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

@RanPix RanPix added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Jan 17, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 17, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants