Bug 52429 - code formatter seems to ignore settings
Summary: code formatter seems to ignore settings
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-18 16:25 EST by mhawthorne CLA
Modified: 2004-03-25 07:29 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mhawthorne CLA 2004-02-18 16:25:19 EST
Maybe I'm just misunderstanding the way that things work, but there seem to be
some fundamental problems with the code formatter.

For example, if I choose "New Lines / Preserve Existing Line Breaks", then
create a few blank lines in between statements, then choose "Source/Format", it
gets rid of my blank lines.  This isn't what I expect.

--------------------------------

The entire line break system seems to be a bit screwy.

For example, I would expect the following line:

private static final Log logger = LogFactory.getLog(ServiceContextFactory.class);

To be split into:

private static final Log logger = 
    LogFactory.getLog(ServiceContextFactory.class);

But it frequently ends up as:

private static final Log logger = LogFactory
            .getLog(ServiceContextFactory.class);

or:

private static final Log logger = LogFactory
.getLog(ServiceContextFactory.class);

And I've been spending a lot of time trying to get what I want, with
inconsistent results.

--------------------------------

I've had the comment formatting turned off since a few version ago, because it
always seemed to get rid of my white space and leave me with code like:

statement; /*
* comment
*/

Which is just a disaster.

--------------------------------

Thanks for any help, but it just seems that either I'm missing something, or
there is a definite disconnect between the Code Formatter settings that I
choose, and what actually  happens when I click "Source/Format"

Thanks for any help or info you can provide.
Comment 1 Olivier Thomann CLA 2004-02-18 16:53:55 EST
See bug 51623 and bug 52305.
Preserve user line breaks will be removed.
Comment 2 Olivier Thomann CLA 2004-02-23 13:03:14 EST
The option "preserve user line breaks" has been removed from the code formatter.
It will be removed from the UI soon.
Fixed and released in HEAD.
Comment 3 Frederic Fusier CLA 2004-03-25 07:29:53 EST
Verified for 3.0 using build I200403250010.