Writing a codeformatter is boring and errorprone. I hate it because I'm lazy, but is there an alternative? Yes, of course! We're in 2017, folks!
There's a project called Codebuff out there. Codebuff takes examples that are well formatted and trains a machine to format your code in the same way as a programmar who builded the examples would do it. So formatting becomes easy and individual.
So far so good - does that also work for DSLs? DSLs that were created with Xtext? Yes – since yesterday :)
Here's a small video to demostrate how easy it works now.
To be honest – it's still a prototype that is not published yet. We'll come up with a more detailed article – stay tuned.