So, one thing that is important for a plugin is to preserve the debugging experience, specially in the case where the code of the user is modified by a plugin.
In order to do that, you need to add a proper handling of line in your generated code with something like:
#line hidden
// your code
#line insert_real_line_number_here
Check the latest version of Helloworld repo, it is trying to handle a few cases (method empty, method with expression body...etc.) but it is not yet perfect (there are still a few flaws).
I would like to try to find some recurrent patterns that could fit into the compiler directly for example for this case, but before going there, we need to practice it a bit more, so that's good if you can try this.
Hi, super initiative!
So, one thing that is important for a plugin is to preserve the debugging experience, specially in the case where the code of the user is modified by a plugin.
In order to do that, you need to add a proper handling of line in your generated code with something like:
Check the latest version of Helloworld repo, it is trying to handle a few cases (method empty, method with expression body...etc.) but it is not yet perfect (there are still a few flaws).
I would like to try to find some recurrent patterns that could fit into the compiler directly for example for this case, but before going there, we need to practice it a bit more, so that's good if you can try this.