-
Notifications
You must be signed in to change notification settings - Fork 646
Feature Request: Better interface stubbing #1741
Comments
* auto complete for package name * manual search for interface if the input is unavailable * allow user to select type name and use right click to get the type name autocompleted
@matthewmueller could you describe your demand more specific with your directory structure and the path of your project? I would like to take this issue but it seems you just need to type in |
If you put your project under |
@qzyse2017 awesome! I'm not able to reproduce needing the full path, maybe I was typing in the command wrong. that's definitely easier. either way, I think it would be really cool if it could auto implement: |
@matthewmueller I am doing it in a similar way to what you need.
I think steps above can be used in more general conditions. |
Nice, looking forward to this issuer. |
It would also be nice if vscode would provide interface stubbing as a quick fix.
Should provide a quick fix like "generate interface stubs" if Repository doesn't implement goal.Repository |
Feature work in this area will be done in |
It can be hard to get the input right with the current implementation of
Generate Interface Stubs
.For example, if your path is
github.com/matthewmueller/graphql
and you have aQuery
interface and you want yourquery
struct to implement it:With the
Generate Interface Stubs
, you'd need to write in the following:This is quite hard to get right. I think it'd be a lot more useful if it did the following:
var _ Query = (*query)(nil)
Generate Interface Stubs
impl
under the hood with the correct paths. The receiver variable could just be the first letter of the struct (lowercased)Update: Even better would be how typescript does it with the little lightbulb next to any interface enforcement that is currently erroring out.
The text was updated successfully, but these errors were encountered: