-
Notifications
You must be signed in to change notification settings - Fork 645
impl support to generate method stubs for implementing an interface #259
Comments
Nice idea. Happy to accept a PR on this. |
I'll see what I can do when I get some free time. |
As mentioned in #822 here's a little bit of research from the person behind goimpl.
To me after reading the above, I'd rather use impl the code is easier to grok because of AST parse vs loading code with template and then doing reflection. As a user, I wouldn't mind just manually removing any additional methods I already had implemented. Thoughts? @mattetti @ramya-rao-a |
interesting comparison, I'd probably go with |
@itsjamie Feel free to submit a PR for this. If you have questions or doubts on how to go about integrating this, I can answer them for you. |
@ramya-rao-a I put a PR (#939) up that implements the josharian/impl package as a command |
This is now available in the latest update 0.6.62 |
@ramya-rao-a should it work for interfaces in the same file? I'm getting the following error: Cannot stub inteface: unrecognized interface: MyInterface |
@renannprado Did you provide the package name along with the interface? For example: I had to use |
This could be very useful if implemented properly. Many values of the method could be inferred from the code. Ideally I would like to have >GO: GEneratate interface for variable at mouse point -> AutoComplete available interfaces for the given package -> ENTER -> |
@Mistobaan So the advantage over the current method is that you will be able to choose the interface and not remember/type the name of the interface? |
@ramya-rao-a yes. right now if you miss one character of the whole command the prompt resets and you have to type the whole thing again |
Say you want stubs for the In this list, for every interface, we can have another entry which when selected, will insert the stubs. Thoughts? |
Any chance of adding support for impl?
The text was updated successfully, but these errors were encountered: