Eclipse String Wrap Format Does Not Apply to Code

I am trying to use the Eclipse Java Code Formatter. Eclipse 3.5 on Red Hat Linux.

I found code styles in Preferences / Java Style / Code / Formatter.

I created a new profile

Our team uses C ++ style brackets, so I pointed them out. They are well displayed in the preview:

   SomeClass fField = new SomeClass()
    {
    };

I am struggling with installing Line Wrapping. I want most of the listed items to be set to "Wrap all items, each item on a new line" My maximum line width is 80, both indents are set to "1" and "Never connect" are not marked. The preview gives me the desired look, for example. Function calls / arguments:

class Example
{
    void foo()
    {
        Other.bar(
            100,
            200,
            300,
            400,
            500,
            600,
            700,
            800,
            900);
    }
}

, , (Select All → Source → Format), .

class Example
{
    void foo()
    {
        Other.bar(
            100,
            200,
            300,
            400,
            500,
            600,
            700,
            800,
            900);
    }
}

class Example
{
    void foo()
    {
        Other.bar(100, 200, 300, 400, 500, 600, 700, 800, 900);
    }
}

, , .

, .

- , Formformatter , Line Wrapping, ?

", ! ", ...

+3
2

.

3.5, , "Force split".

+1

, , 3.6:

:

  • .
  • , eclipse 3.6? ( Eclipse3.6 : )

, .

0

Source: https://habr.com/ru/post/1772164/


All Articles