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?
Please sign in to leave a comment.
Hello,
Please set "Settings | Editor | Code Style | Java - Wrapping and Braces - Enum Constants" to "Wrap always"
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.
Hello Maud,
We have related issue about Eclipse code style: https://youtrack.jetbrains.com/issue/IDEA-121149