I'm trying to use the Eclipse Java Code formatter. Eclipse 3.5 on Red Hat Linux.
I have found the Code Styles at Preferences / Java / Code Style / Formatter.
I have created a new profile
Our team uses c++ style braces, so I have specified those. They display in the preview nicely:
SomeClass fField = new SomeClass()
{
};
I am struggling with the Line Wrapping facility. I wish to have the majority of listed elements set to "Wrap all elements, every element on a new line" My max line width is 80, both indentations are set to '1' and Never Join Lines is not ticked. The preview gives me the desired look, e.g. Function Calls / Arguments:
class Example
{
void foo()
{
Other.bar(
100,
200,
300,
400,
500,
600,
700,
800,
900);
}
}
However, when I apply the format to actual source code,(Select All -> Source -> Format) the parameters are collapsed onto one line.
class Example
{
void foo()
{
Other.bar(
100,
200,
300,
400,
500,
600,
700,
800,
900);
}
}
becomes
class Example
{
void foo()
{
Other.bar(100, 200, 300, 400, 500, 600, 700, 800, 900);
}
}
I know the formatter is partially working, because it correctly sorts out my brace requirements.
I have tried configuring my Format profile to be both project specific, and to apply generally with the same results.
Is there a gotcha that would prevent the Code Formatter applying Line Wrapping, but still apply other formats?
In several years of development this is my first "Wah, I need help! request", as I've been bashing my head for a while...
Thanks