openrewrite / rewrite-templating

Automated templating using code snippets.
Apache License 2.0
16 stars 7 forks source link

Retain and insert comments added to a replacement template #88

Open timtebeek opened 6 months ago

timtebeek commented 6 months ago

What problem are you trying to solve?

Sometimes it's helpful to insert context to a code changes through the use of comments in a replacement template.

Describe the solution you'd like

Any comments in replacement templates, whether single line or multi line, retained and inserted along with the code change.

Alternatives

Folks can copy the generated recipe from target/ or build/ into src/ and add the comments there.

Additional context

This came up as a request through internal channels; logged as an issue here to track progress towards that.

Philzen commented 5 months ago

I believe solving may go hand-in-hand with