Summary: | [Formatter] should have separate 'preserve existing line breaks' for code and comment formatting | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | enhancement | ||||||||
Priority: | P3 | CC: | jerome_lanneluc | ||||||
Version: | 3.5 | ||||||||
Target Milestone: | 3.5 M4 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Dani Megert
2008-12-08 06:29:51 EST
Here's the new formatter constant proposal: /** * <pre> * FORMATTER / Option to specify whether the formatter should preserve existing line breaks in comments or not * * For example, the following comment: * /** * * The foo method. * * foo is a substitute for bar. * */ * public class X { * } * * will be unchanged by the formatter when this new preference is used. * * - option id: "org.eclipse.jdt.core.formatter.preserve_existing_comments_line_breaks" * - possible values: { TRUE, FALSE } * - default: FALSE * </pre> * @since 3.5 */ public static final String FORMATTER_PRESERVE_EXISTING_COMMENTS_LINE_BREAKS = JavaCore.PLUGIN_ID + ".formatter.preserve_existing_comments_line_breaks"; //$NON-NLS-1$ What about: FORMATTER_DO_NOT_JOIN_LINES_IN_COMMENTS I suggested 'FORMATTER_DO_NOT_JOIN_LINES_IN_COMMENTS' because I think it's closer to what it does. Even with the Javadoc from comment 1 it is not clear to the client what happens e.g. with the 'remove blank lines' option as those are also existing line breaks. (In reply to comment #3) > I suggested 'FORMATTER_DO_NOT_JOIN_LINES_IN_COMMENTS' because I think it's > closer to what it does. Even with the Javadoc from comment 1 it is not clear to > the client what happens e.g. with the 'remove blank lines' option as those are > also existing line breaks. > Good point, blank lines are also line breaks but are effectively not preserved when 'remove blank lines' option is set... Jerome, do you also agree? Instead of having a negative constant name, what about "FORMATTER_JOIN_LINES_IN_COMMENTS" with a default set to TRUE ? >"FORMATTER_JOIN_LINES_IN_COMMENTS" with a default set to TRUE ?
Would also be OK for me.
Created attachment 119787 [details] Proposed patch This patch also fixes bug 257907... Created attachment 119790 [details]
Fixed proposed patch
Ooops, I forgot to remove the unexpected specific option for javadoc comments...
This new patch is clean now.
Patch works for me. Released for 3.5M4 in HEAD stream. Verified for 3.5M4 using I20081209-0100 |