Bug 52940

Summary: Formatter: Separate control of new lines in control statements by statement type
Product: [Eclipse Project] JDT Reporter: Dale King <DaleWKing>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dale King CLA 2004-02-24 10:10:55 EST
There is a single control for specifying whether a new line is inserted in 
control statements. This affects whether an else is on a new line and whether 
the while in a do-while is on a new line. I don't know if this also affects 
placement of catch and finally, but it would make sense if it did.

The problem is that I don't want each statement type to be treated the same. I 
do want else, catch and finally on a new line. But I do not want the while on a 
new line. With the while on a new line it might be misinterpreted as an empty 
while loop instead of the end of the end of a do-while. With it on the same 
line it makes it obvious without having to go check if the block above has a do.

So there should be separate options for each type of control statement.
Comment 1 Olivier Thomann CLA 2004-04-19 16:52:33 EDT
These options have been added:

FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT
FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT
FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT
FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT

FORMATTER_INSERT_NEW_LINE_IN_CONTROL_STATEMENTS is deprecated. It will be
removed as soon as the UI is updated to show the new options.

Fixed and released in HEAD.
Regression tests have been updated.
Comment 2 David Audel CLA 2004-05-18 10:23:24 EDT
Verified for 3.0M9