rebugger
rebugger copied to clipboard
Feature Request : Custom Annotation + Compiler plugin
It would be neat if Rebugger had a KSP artifact that processed annotations on compostable functions to automatically insert the necessary Rebugger function calls within the function body - is something like that even possible?
The annotation could have parameters to control what inputs are tracked by Rebugger (function arguments, state objects within the function body, or both)
@erawhctim

This is something that I initially thought about. But thinking about the additional build time it can introduce, I prioritized developing an IDE plugin to generate the Rebugger call first. (See #1). Do you still think the annotation-processor would be better? If yes, would you explain a bit?
Thanks for the extra context! I do think a compiler plugin based approach is more convenient from a developer's perspective (IMO):
- If the Rebugger calls are automatically generated by the compiler, the developer doesn't need to manually manage the
trackMapparameters or remember to go back and add new ones - It's much faster to slap an annotation on a function than write up the Rebugger call manually (though, this sounds like the main motivation for the IDE plugin)
- The build time impact is definitely a valid concern; I would hope that KSP would bring some performance gains over a kapt-based processor (but to be honest I would just measure the build time impact after building a PoC before deciding to ship it)
I personally find that compiler plugins are more portable than IDE plugins (they still work if I'm building on the command line 🙂), but I realize that's just my own perspective.
Either way, I'd love to help/collab on this if you're looking for outside contributors! happy to take a stab at building a compiler plugin PoC
@erawhctim
I personally find that compiler plugins are more portable than IDE plugins (they still work if I'm building on the command line 🙂), but I realize that's just my own perspective.
Fair request
I'd love to help/collab on this if you're looking for outside contributors! happy to take a stab at building a compiler plugin PoC
That'd be great! Let's discuss this. Sending you a DM in kotlinlang slack ✋
@theapache64 Hi. I already have similar compiler plugin. I can simply add a rebugger as an additional logging option. What you think about this?
Great. Can you publish an MVP ?
@theapache64 Yes. I completed integration, I will let you know when it is merged and published.
https://user-images.githubusercontent.com/105854390/236830779-ebab6072-effb-4c84-b7ad-2d7715993092.mov
Great stuff!!!
I will let you know when it is merged and published.
Sure!
@theapache64 Hi. Plugin with rebugger support has been published. The plugin adds a rebugger call to the beginning of the function and track every function argument. But it doesn't track state properties that was declared inside function. I would glad to hear any proposals or comments. I also would glad if you mention that plugin in Rebugger README :)
@EvgeniyKurinnoy I tried using the plugin, but i don't see the useRebugger options or @Rebugger annotation anywhere. Am i missing something?
@theapache64 useRebugger option available in module build.gradle
Additional annotations is not required, because plugin looks at the @Composable annotation