IntelliJ 2021.1 adds support for Java 16. And Java 16 adds the new feature of records.
When I define a record locally in IntelliJ 2021.1, the formatting command results in this format:
record Grid(int[] array , int count)
{
}
Is there a way in the auto-formatting rules to keep a record definition to a single line rather than line-wrapping the empty curly braces?
➥ What I want:
record Grid(int[] array , int count) {}
I also want SPACE character before and after each of the parentheses. But the auto-formatting rules already cover that; just seems broken for records. I assume that will be fixed eventually.
What I really want:
record Grid ( int[] array , int count ) {}
                Here is one way to achieve that formatting:
Settings -> Editor -> Code Style -> Java, Wrapping and Braces tab
Keep when reformatting section

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With