code formatting

Answered

I have a Java enum such as:

 

public enum ERLI_FIELD_NAMES {

AMOUNT_SPENT("amountSpent"),
EXPENSE_REPORT_ITEM_TYPE("expenseReportItemType"),
HAS_RECEIPT("hasReceipt"),
IS_FIRM_PAID("isFirmPaid"),
IS_PERSONAL("isPersonal"),
DESCRIPTION("description"),
BUSINESS_PURPOSE("businessPurpose");

Which "always" get reformatted automatically (after an unknown time i.e. two min later, when I come back to my enum, it is reformatted).  It reformat it as follow:

public enum ERLI_FIELD_NAMES {

AMOUNT_SPENT("amountSpent"), EXPENSE_REPORT_ITEM_TYPE("expenseReportItemType"), HAS_RECEIPT("hasReceipt"), IS_FIRM_PAID(
"isFirmPaid"), IS_PERSONAL("isPersonal"), DESCRIPTION("description"), BUSINESS_PURPOSE("businessPurpose");

Is there a way to either disable this "automatic reformatting"?  OR a way to make/control this "reformatting" to conform to what I want?

0
3 comments

Hello,

Please set "Settings | Editor | Code Style | Java - Wrapping and Braces - Enum Constants" to "Wrap always"

1
Avatar
Permanently deleted user

This just doesn't work for me, I'm using imported eclipse settings, but it just ignores that setting and the enum looks terrible as above.

0

Hello Maud,

We have related issue about Eclipse code style: https://youtrack.jetbrains.com/issue/IDEA-121149

0

Please sign in to leave a comment.