How to stop Eclipse formatter from placing all enums on one line

后端 未结 6 769
感情败类
感情败类 2021-01-30 03:55

I have enums like:

public static enum Command
{
login,
register,
logout,
newMessage
}

When formatting the file, the output becomes:

<         


        
6条回答
  •  萌比男神i
    2021-01-30 04:09

    You need to set the line wrapping policy under enum declaration for "Constants."

    Set the wrapping policy to

    • Wrap all elements, every element on a new line

    AND

    • Check the box that says "Force Split, even if line shorter than,,,,,

提交回复
热议问题