Skip to content

x/tools/gopls: extract(refactor) fails on anonymous structs  #61496

Open
@KrzysztofJopek

Description

@KrzysztofJopek

What version of Go are you using (go version)?

go version go1.20.6 darwin/amd64

golang.org/x/tools/gopls v0.12.4
    golang.org/x/tools/gopls@(devel)

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

darwin, amd64

What did you expect to see?

Refactor of code with anonymous struct completes successfully

What did you see instead?

parent nil error while extracting code with anonymous struct
I was able to reproduce the issue in both Neovim and VSCode.

On the demo below, you can see a successful refactor of named struct and then fail on anonymous struct.
https://github.com/golang/go/assets/27726430/f3096917-4158-4bf1-be52-4477863fa454

Metadata

Metadata

Assignees

Labels

ToolsThis 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

Relationships

None yet

Development

No branches or pull requests

Issue actions