Bug 47620

Summary: [formatting] curious wrapping for line comment
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: jsholl, justincemail-eclipse, mlists, nikolaymetchev, patrice_kerremans, sdavids
Version: 3.0   
Target Milestone: 3.3 RC4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2003-11-27 07:15:51 EST
Build 3.0M5 + JDTCore HEAD from 20031127

Following code in AND_ANDExpression:

rightInfo.setReachMode(previousMode); // reset after trueMergedInfo got 
extracted

gets formatted into:

rightInfo.setReachMode(previousMode); // reset
                                      // after
                                      // trueMergedInfo
                                      // got
                                      // extracted
Comment 1 Philipe Mulet CLA 2003-11-27 07:29:38 EST
My settings were:
- max code line length: 100
- max comment line length: 80
Comment 2 Olivier Thomann CLA 2003-11-27 09:08:36 EST
This is not done by our formatter. You have the formatting of comment selected.
See Preferences>Java>Code formatter>Comments.
If this is checked, then it should be moved to JDT/UI or change the 
preferences.
Comment 3 Olivier Thomann CLA 2003-11-27 13:39:37 EST
Move to JDT/UI.
Comment 4 Kai-Uwe Maetzel CLA 2003-11-28 08:07:36 EST
What's your expectation?
Comment 5 Philipe Mulet CLA 2003-11-28 09:02:31 EST
I'd rather have the comment moved to next line if not a NON-NLS tag.
One word per line is really unreadable...
Comment 6 Dani Megert CLA 2004-01-08 02:37:18 EST
*** Bug 49623 has been marked as a duplicate of this bug. ***
Comment 7 Nikolay Metchev CLA 2004-01-08 04:15:59 EST
if the end of line comment was on a field decleration you could turn it into a 
/*...*/ comment before the field!
Comment 8 Dani Megert CLA 2004-01-08 04:21:15 EST
We could do this for all single-line comments that exceed the length. Having
consecutive lines of single-line comments looks ugly.
Comment 9 Dani Megert CLA 2004-01-12 11:59:08 EST
*** Bug 47757 has been marked as a duplicate of this bug. ***
Comment 10 Tom Hofmann CLA 2004-01-29 17:35:43 EST
*** Bug 50899 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2004-02-03 05:30:04 EST
*** Bug 50900 has been marked as a duplicate of this bug. ***
Comment 12 Dani Megert CLA 2004-10-19 13:07:36 EDT
*** Bug 76543 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2004-10-20 11:53:56 EDT
*** Bug 76660 has been marked as a duplicate of this bug. ***
Comment 14 Dani Megert CLA 2005-10-10 12:46:11 EDT
Ownership changed.
Comment 15 Olivier Thomann CLA 2007-02-08 10:37:32 EST
Using 3.3M5, line comment can be left untouched while formatting other comments is enabled (block and javadoc).
I don't think the code formatter can do anything about the way the comment should be formatted. Moving it to the next line or the line before the statement can be misleading.
Splitting it the way it is done right now is ugly.
So I would simply recommend to disable line comment formatting.
Any thought?
Comment 16 Olivier Thomann CLA 2007-06-21 10:55:01 EDT
The new option to disable the line comment formatting should be used.
No further action plan.