-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: support fillstruct for partially-filled structs #39804
Comments
Change https://golang.org/cl/262018 mentions this issue: |
https://golang.org/cl/262018 now adds support for partially filled structs - wooo! But, all comments get destroyed. =) Coming to a crossroads, now that I'm tackling comments. The I had hoped that So, the crossroads I'm at: Option A: github.com/dave/dstIt looks like github.com/dave/dst has what I'm looking for: comments tied directly to nodes. But, introducing a v0 dependency seems sketchy. Option B: hacky printingI vaguely bet there's a way to figure out the fields that are already set ( @joshbaum @stamblerre are there any directions that I'm missing? If not, any preference on the above? |
I think Option B would be best, as we'd like to avoid adding dependencies to x/tools. |
Ah! Ok, that helps a lot. I actually haven't tried all the other tests, but not sure. I'll give option B a shot, and then if that doesn't work will either rewrite comments or just not work when comments exist. :) Will report back soon! |
We currently only offer fillstruct for completely empty struct literals. We should also offer to fill in values for partially filled structs.
/cc @joshbaum
The text was updated successfully, but these errors were encountered: