Is there a way I can configure eclipse to prefer breaking a long assignment by putting the ‘=’ on a new line, and avoid breaking on a ‘.’ character for a method invokation. I’ve noticed a bunch of settings like:
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
that can be added to an xml file that can be used to specify formatting, but I’m not sure which settings I should change to have the desired effect. Are these configurations documented somewhere (I tried Googling some relevant terms to no avail).
The setting you’re looking for regarding assignment line breaks is in:
where you can select your preferred line wrapping policy and indentation policy.
As for avoiding line breaks, still on the
Line Wrappingtab, change the line wrapping policy onFunction Calls>Qualified invocationsto “Do not wrap”.In both cases, you can play with the preview width to see what effect the various policies will have on how your code is formatted.