IntelliJ sort enum members

Viewed 2866

Is there any way to sort the member variables of an enum alphabetically in IntelliJ? I've been trying a bunch of different settings in the arrangement section but didn't have success. Could anyone maybe help me?

1 Answers

Type Alt+Enter on an enum constant and invoke the sort content intention. This will sort the enum constants in alphabetical order. The intention will only appear if the constants are not alphabetically sorted.

Related