Bug 52940 - Formatter: Separate control of new lines in control statements by statement type
Summary: Formatter: Separate control of new lines in control statements by statement type
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-24 10:10 EST by Dale King CLA
Modified: 2004-05-18 10:23 EDT (History)
0 users

See Also:


Attachments

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