Community
Participate
Working Groups
Created attachment 208519 [details] Patch adding the FormatComment flag to GenModel The Code Formatting flag causes the code formatter to be invoked in a way that does not format comments. I.e. the method CodeFormatter.format requires the bitmask parameter "kind" to have the bit CodeFormatter.F_INCLUDE_COMMENTS set. Otherwise it will not attend to formatting comments. To enable the formatting of comments in an backward compatible way I propose the addition of a flag "Format Comments", whose setting is delegated to the format-method. I have attached a patch that realizes this. I did not include the generated portion of the code. So in addition to applying the patch, the model and edit code requires regeneration.
When experimenting with this, it looks like the resulting format is unspeakably hideous. /** * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- * end-user-doc --> * * @generated */ Do you really want/need results that look like this? Have you done something with your options for comment formatting that doesn't result in this kind of hideousness?
Slightly modified changes have been committed to git for 2.8. I wanted to make sure that we didn't break API by changing the formatCode signature, so I added an overload and make sure that the old one is called when comment formatting is enabled.
The changes are available in the M6 build.