Bug 59000 - Code formatter struggles with end-of-line comments
Summary: Code formatter struggles with end-of-line comments
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-17 21:15 EDT by Ian Brown CLA
Modified: 2004-05-18 10:46 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 Ian Brown CLA 2004-04-17 21:15:44 EDT
In the array initialise line-wrapping configuration that I have, I have 
configured for each element to be on its own line, and to "force split"

If I then do a class-level array declaration like this:

   int[] x =
      {
         1,//a
         2,//b
         3,//c
         4,//d
      };

and then format it, I get this:

   int[] x =
      {
         1,
         //a
         2,
         //b
         3,
         //c
         4,
      //d
      };

The end-of-line comments should get let on, er, the end of the lines!

PS This may have some connection to issue 58999 - which is to do with code 
formatter handling of //$NON-NLS-x$ tags, which are also end-of-line comments
Comment 1 Dani Megert CLA 2004-04-19 03:50:01 EDT
which build?
Comment 2 Philipe Mulet CLA 2004-04-19 06:28:13 EDT
A line comment shouldn't be treated as a different element...
Comment 3 Ian Brown CLA 2004-04-19 14:44:36 EDT
Sorry - this is in M8, with no third-party plugins
Comment 4 Olivier Thomann CLA 2004-04-19 16:56:02 EDT
Fixed and released in HEAD.
Regression tests added.
Comment 5 David Audel CLA 2004-05-18 10:46:31 EDT
Verified for 3.0M9