@Setter
@Getter
private String query;
I get something like this after formatting, how to prevent it and keep my annotations in one line? I didn't find any usable setting inside Formater configuration.
@Setter @Getter @sthElse @oneMore @etc
private String query;
This is how I would like it to be
IMHO the closest you can get is:
@Setter @Getter @sthElse @oneMore @etc private String query;
(via Formatter->New Lines->Insert new lines after annotations on Method
One hack that allows you to force a newline whenever you want is to add a in-line comment (//
) to the end of the line. For example, when I have annotations on parameters, I want them to line up like this:
public ModelView finish(//
@PathParam("stampId")//
long stampId, //
Instead of like this:
public ModelView finish(@PathParam("stampId") long stampId,
My use of //
gives me more fine grained control over this. So if you change the
"insert new lines after annotations" setting you should be able to get:
@Setter @Getter @sthElse @oneMore @etc //
private String query;
I'm sure if I took a look at the Eclipse formatting code I could add it there but I don't have the time for that. :-)
When you're editing your formatting profile, select the 'New Lines' tab. There's a grouping labelled 'Annotations' on that preference page. You should be able to deselect the preferences to "Insert new line after annotations on members/parameters/local variables"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With