x/tools/gopls: handle undefined struct type in undeclaredname
autofix code action
#69947
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
golang.org/x/tools/gopls v0.16.2
go env
What did you do?
I ran an autofix code action for an undefined struct.
What did you see happen?
gopls
generated a new variable instead of a struct type definition.This is nonsensical from a user point of view & also doesn't compile.
What did you expect to see?
A struct type definition above the function body.
Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: