Java 8: Formatting lambda with newlines and indentation

后端 未结 9 1148
[愿得一人]
[愿得一人] 2020-12-12 23:46

What I would like to achieve with lambda indentation is the following:

Multi-line statement:

String[] ppl = new String[] { \"Karen (F)\", \"Kevin (M)         


        
9条回答
  •  死守一世寂寞
    2020-12-12 23:47

    In Eclipse, for the single-line statements:

    In your project or global preferences, go to Java -> Code Style -> Formatter -> Edit -> Line Wrapping -> Function Calls -> Qualified Invocations, set Wrap all elements, except first if not necessary and tick Force split, even if line shorter than maximum line width.

提交回复
热议问题