Issue
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).
Solution
The setting you're looking for regarding assignment line breaks is in:
Window (menu) > Preferences > Java > Code Style > Formatter
> Edit... (on active profile) > Line Wrapping (tab) > Expressions
> Assignments
where you can select your preferred line wrapping policy and indentation policy.
As for avoiding line breaks, still on the Line Wrapping
tab, change the line wrapping policy on Function Calls
> Qualified invocations
to "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.
Answered By - Amos M. Carpenter
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.