Bug 6747

Summary: Code Formatter exchange several blank lines w/ one
Product: [Eclipse Project] JDT Reporter: Sebastian Davids <sdavids>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: analogue, hklingsp
Version: 2.0   
Target Milestone: 3.0 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Sebastian Davids CLA 2001-12-10 13:27:31 EST
Right now one only has the following two options:

(1) either leave all blank lines
(2) remove all blank lines

I would appreciate the following option:

(3) replace several blank lines with XX lines (default = 1)

Example:

@@ Before -- same as Option (1) @@

//just a comment
int b;



//another one
int b2;
char a;

b3.foo();

@@

@@ after "Code Format" w/ Option (2) @@

//just a comment
int b;
//another one
int b2;
char a;
b3.foo();

@@

@@ after "Code Format" w/ Option (3) "replace with '1' line" @@

//just a comment
int b;

//another one
int b2;
char a;

b3.foo();

@@

Usually one "consciously" inserts those blank lines to separate statements 
belonging to each other from others -- Option (1) is that viable in that case.

Sometimes one just forgets to delete the extraneous lines -- it would be nice 
if the formatter could delete them -- right now one has to hunt for them 
manually ...

Sebastian Davids
Comment 1 Sebastian Davids CLA 2001-12-10 13:54:18 EST
At the bottom I ment "not viable" ;-)
Comment 2 Olivier Thomann CLA 2002-01-29 13:40:10 EST
Defer till post 2.0.
Comment 3 Philipe Mulet CLA 2002-07-25 06:30:58 EDT
Resurrecting formatter issues in 2.1 stream.
Comment 4 Philipe Mulet CLA 2002-07-25 06:32:46 EDT
Clearing resolution
Comment 5 Olivier Thomann CLA 2003-01-15 13:22:55 EST
We need to clear 2.1 bug reports that won't be addressed before 2.1. The new 
implementation is still in the works. Therefore we cannot include it for 2.1. 
Not enough testing and we need to polish the preferences. This will be address 
for 2.2 as stated in the JDT/Core plan.
Comment 6 Philipe Mulet CLA 2003-06-12 06:36:03 EDT
Resurrecting for 3.0
Comment 7 Olivier Thomann CLA 2003-06-12 15:58:53 EDT
Reopen for 3.0 consideration.
Comment 8 Olivier Thomann CLA 2003-10-03 09:34:05 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 9 Sebastian Davids CLA 2003-10-03 10:14:40 EDT
verified

Version: 3.0.0
Build id: 200309300010