edolphin-ydf / goimpl.nvim

Generate stub for interface on a type
56 stars 6 forks source link

Add support for Monorepos #16

Closed theoribeiro closed 2 months ago

theoribeiro commented 5 months ago

When using your plugin in our monorepo I noticed that impl couldn't find any go packages as it is being run from the root of the repository, which is not the go project I was trying to find the interface for.

A very simple and naive implementation solves it by changing the directory to dirname before running impl. I'm not sure this would break other use cases but in my tests with both mono and multi repos it was working just fine.

Don't know if you'd have a better solution for this but decided to open a PR to start the discussion. Happy to make adjustments if you think it's needed.