When both "Simple blocks on one line" and "Force braces" are both enabled, single line "simple blocks" are initially switched to multi-line blocks.
Given:
if (x > y) System.out.println("foo!");
Is formatted to:
if (x > y)
{
System.out.println("foo!");
}
When this is expected:
if (x > y) { System.out.println("foo!"); }
If the statement was a simple one-line block before adding braces, I would think it should remain one after the braces have been added. It would improve usability if we didn't have to manually change these lines back to single-line simple blocks after formatting.
I've attached several screen shots and a simple project with code formatting settings included.
This affects both v7.0.4 and v8.0M1 and this is related to IDEA-19321.
Description
When both "Simple blocks on one line" and "Force braces" are both enabled, single line "simple blocks" are initially switched to multi-line blocks.
Given:
if (x > y) System.out.println("foo!");
Is formatted to:
if (x > y)
{
System.out.println("foo!");
}
When this is expected:
if (x > y) { System.out.println("foo!"); }
If the statement was a simple one-line block before adding braces, I would think it should remain one after the braces have been added. It would improve usability if we didn't have to manually change these lines back to single-line simple blocks after formatting.
I've attached several screen shots and a simple project with code formatting settings included.
This affects both v7.0.4 and v8.0M1 and this is related to IDEA-19321.