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: explore UX of fillstruct for partially populated nested structs #42818

Open
jeanbza opened this issue Nov 24, 2020 · 1 comment
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.

Comments

@jeanbza
Copy link
Contributor

jeanbza commented Nov 24, 2020

Continuation of #39804, in which in cl262018 we introduce basic support for partially filled structs: how should this work for nested structs? Should all levels of the nested structs populate? Or only one level? If one level, which level, when the cursor is between two of the nested struct levels, like,

f := Foo{
  Bar: {}, // cursor is on the closing bracket: fill Foo, or Bar, or both?
}
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 24, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 24, 2020
@findleyr findleyr added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Jan 17, 2025
@findleyr
Copy link
Member

Given that the user can invoke fillstruct again on the nested composite literal, I think the current behavior of filling in the zero value for the nested struct is best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

4 participants