Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 204960

Summary: [formatter] Indentation 'Align fields in columns' is too greedy
Product: [Eclipse Project] JDT Reporter: Nick T <nickt31>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: eric_jodet, frederic_fusier, mateusz.matela
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nick T CLA 2007-09-28 17:05:29 EDT
The 'Align fields in columns' selection on the 'Indentation' tab of the Formatter profile is a very useful tool, but behaves a bit too greedily when it comes to "groups" of fields (or variables).

It would be a great benefit if there was a way to specify the number of blank lines that the field aligner would skip before starting over on a new group.


For example, if the line limit was zero...

private int i;
private boolean yesNo;

private LongSupportClassNameThatTakesUpSpace supportOne;
private ShortSupport supportTwo;


private Oval circle;
private Rectangle square;


...would become...

private int     i;
private boolean yesNo;

private LongSupportClassNameThatTakesUpSpace supportOne;
private ShortSupport                         supportTwo;


private Oval      circle;
private Rectangle square;


...if the limit was one, it would become...

private int                                  i;
private boolean                              yesNo;

private LongSupportClassNameThatTakesUpSpace supportOne;
private ShortSupportClassName                supportTwo;


private Oval      circle;
private Rectangle square;


...and two would become...

private int                                  i;
private boolean                              yesNo;

private LongSupportClassNameThatTakesUpSpace supportOne;
private ShortSupportClassName                supportTwo;


private Oval                                 circle;
private Rectangle                            square;
Comment 1 Mateusz Matela CLA 2016-01-14 17:17:33 EST

*** This bug has been marked as a duplicate of bug 479109 ***