Issue
@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
Solution
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. :-)
Answered By - Gray
Answer Checked By - Willingham (JavaFixing Volunteer)