Bug 257907 - [Formatter] FORMATTER_PRESERVE_EXISTING_LINE_BREAKS needs clarification
Summary: [Formatter] FORMATTER_PRESERVE_EXISTING_LINE_BREAKS needs clarification
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-08 06:31 EST by Dani Megert CLA
Modified: 2008-12-09 13:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2008-12-08 06:31:25 EST
I20081202-1812.

The FORMATTER_PRESERVE_EXISTING_LINE_BREAKS option says:

Option to specify whether the formatter should preserve existing line breaks or not

This is too generic. It should tell more precisely what it does i.e. in which cases it applies.
Comment 1 Frederic Fusier CLA 2008-12-08 06:58:30 EST
I think this one should go into 3.5M4 as well, otherwise we would need to deprecate it if we decided to change the name (as I'm intending to do....)
Comment 2 Frederic Fusier CLA 2008-12-08 07:03:54 EST
So, instead of the too generic one, here's the new constant proposal:
/**
 * <pre>
 * FORMATTER / Option to specify whether the formatter should preserve existing wrapping line breaks or not
 * 
 * 		For example, the wrapped lines of method foo return statement in following test case:
 * 			class X {
 * 			String foo() {
 * 			return "select x "
 * 			       + "from y "
 * 			       + "where z=a";
 * 			}
 * 			}
 *
 * 		will be preserved by the formatter when the new preference is used,
 * 		hence produces the following output:
 * 			class X {
 * 			    String foo() {
 * 			        return "select x "
 * 			                + "from y "
 * 			                + "where z=a";
 * 			    }
 * 			}
 *
 *     - option id:         "org.eclipse.jdt.core.formatter.preserve_existing_wrapping_line_breaks"
 *     - possible values:   { TRUE, FALSE }
 *     - default:           FALSE
 * </pre>
 * @since 3.5
 */
public static final String FORMATTER_PRESERVE_EXISTING_WRAPPING_LINE_BREAKS = JavaCore.PLUGIN_ID + ".formatter.preserve_existing_wrapping_line_breaks";	//$NON-NLS-1$
Comment 3 Jerome Lanneluc CLA 2008-12-08 07:49:21 EST
I think the name should be consistent with what's proposed in bug 257906.
So what about "FORMATTER_JOIN_WRAPPED_LINES" with a default set to TRUE ?
Comment 4 Frederic Fusier CLA 2008-12-08 11:13:07 EST
Patch of bug 257906 was released for 3.5M4 in HEAD stream which fixes this bug as well.
Comment 5 Kent Johnson CLA 2008-12-09 13:43:28 EST
Verified for 3.5M4 using I20081209-0100