Bug 6747 - Code Formatter exchange several blank lines w/ one
Summary: Code Formatter exchange several blank lines w/ one
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-10 13:27 EST by Sebastian Davids CLA
Modified: 2003-10-03 10:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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