I am generating Java Code from my Domain specific Language (DSL). My Language is using String Template files for generating Java Code from DSL.
My problem is that String Template files generate un-formatted Java code in Eclipse. Whenever I generated code, I have to press cntr + Shift + F to format each generated Java file.
Is there any way of generating formatted code ? I am using Eclipse IDE.
You have to take care of indentation in your
StringTemplatetemplates. I tend to write templates for fragments of code such as a function definitions, function calls or even argument declarations that have to be expanded over a collection of variable elements, and combined them programmatically as arguments to a single souce file template.