-
Notifications
You must be signed in to change notification settings - Fork 757
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
please use CodeAction for related code generation #2630
Comments
Thanks for filing feature requests @sslime336
|
yeah, using CodeActions, I mean, just press Ctrl plus "." or Alt + Enter like Goland and select the options we needed may be more convenient :) Actually I haven't thought about generateing a struct from an interface as you mentioned :P, that's a possible option (but I don't know how to find out where to generate the struct that will impl the selected interface, especially when the interface is in a read-only file, we need to figure out the correct place) Currently, I have these ideas where the CodeAction can be used:
I'm not familiar with gopls so currently I could only think the ways to impl these features using TypeScript. But I'd like to learn more and mk a contribution as I depend on vscode-go seriously :-) |
Change https://go.dev/cl/468658 mentions this issue: |
Is your feature request related to a problem? Please describe.
Umm... no? The snippet like
meth
is helpful but I think below looks better.Describe the solution you'd like
Like rust-analyzer and Goland, we can simply press
Ctrl + .
orAlt + Enter
to generate a method of our own data structure.RA(rust-analyzer):
Goland:
Describe alternatives you've considered
None.
Additional context
Actually I've written some very simple code to achieve this for fun, but my code is in poor quality and I am very new to vscode extension dev!
My fork, coded so poor :P
The text was updated successfully, but these errors were encountered: