mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
IDEA-19328 "Simple blocks on one line" and "Force braces" aren't applied ideally
Corresponding test is added
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.psi.formatter.java;
|
||||
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
|
||||
/**
|
||||
* Is intended to hold specific java formatting tests for 'braces placement' settings (
|
||||
* <code>Project Settings - Code Style - Alignment and Braces</code>).
|
||||
@@ -59,4 +61,16 @@ public class JavaFormatterBracesTest extends AbstractJavaFormatterTest {
|
||||
" }\n" +
|
||||
"}");
|
||||
}
|
||||
|
||||
public void testSimpleBlockInOneLinesAndForceBraces() throws Exception {
|
||||
// Inspired by IDEA-19328
|
||||
getSettings().KEEP_SIMPLE_BLOCKS_IN_ONE_LINE = true;
|
||||
getSettings().IF_BRACE_FORCE = CodeStyleSettings.FORCE_BRACES_ALWAYS;
|
||||
|
||||
doMethodTest(
|
||||
"if (x > y) System.out.println(\"foo!\");",
|
||||
|
||||
"if (x > y) { System.out.println(\"foo!\"); }"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user