use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testSpacesBeforeLBrace.
public void testSpacesBeforeLBrace() throws Exception {
final CommonCodeStyleSettings settings = getSettings();
settings.SPACE_BEFORE_CLASS_LBRACE = true;
settings.SPACE_BEFORE_METHOD_LBRACE = true;
settings.SPACE_BEFORE_IF_LBRACE = true;
settings.SPACE_BEFORE_ELSE_LBRACE = true;
settings.SPACE_BEFORE_WHILE_LBRACE = true;
settings.SPACE_BEFORE_FOR_LBRACE = true;
settings.SPACE_BEFORE_DO_LBRACE = true;
settings.SPACE_BEFORE_SWITCH_LBRACE = true;
settings.SPACE_BEFORE_TRY_LBRACE = true;
settings.SPACE_BEFORE_CATCH_LBRACE = true;
settings.SPACE_BEFORE_FINALLY_LBRACE = true;
settings.SPACE_BEFORE_SYNCHRONIZED_LBRACE = true;
settings.SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE = true;
doTest();
settings.SPACE_BEFORE_CLASS_LBRACE = false;
settings.SPACE_BEFORE_METHOD_LBRACE = false;
settings.SPACE_BEFORE_IF_LBRACE = false;
settings.SPACE_BEFORE_ELSE_LBRACE = false;
settings.SPACE_BEFORE_WHILE_LBRACE = false;
settings.SPACE_BEFORE_FOR_LBRACE = false;
settings.SPACE_BEFORE_DO_LBRACE = false;
settings.SPACE_BEFORE_SWITCH_LBRACE = false;
settings.SPACE_BEFORE_TRY_LBRACE = false;
settings.SPACE_BEFORE_CATCH_LBRACE = false;
settings.SPACE_BEFORE_FINALLY_LBRACE = false;
settings.SPACE_BEFORE_SYNCHRONIZED_LBRACE = false;
settings.SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE = false;
doTest("SpacesBeforeLBrace.java", "SpacesBeforeLBrace.java");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testSCR259.
public void testSCR259() throws Exception {
myTextRange = new TextRange(36, 60);
final CommonCodeStyleSettings settings = getSettings();
settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS;
settings.KEEP_LINE_BREAKS = false;
doTest();
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testStringBinaryOperation.
public void testStringBinaryOperation() throws Exception {
final CommonCodeStyleSettings settings = getSettings();
settings.ALIGN_MULTILINE_ASSIGNMENT = false;
settings.ALIGN_MULTILINE_BINARY_OPERATION = false;
doTextTest("class Foo {\n" + " void foo () {\n" + "String s = \"abc\" +\n" + "\"def\";" + " }\n" + "}", "class Foo {\n" + " void foo() {\n" + " String s = \"abc\" +\n" + " \"def\";\n" + " }\n" + "}");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testSCR1535.
public void testSCR1535() throws Exception {
final CommonCodeStyleSettings settings = getSettings();
settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
settings.CLASS_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
doTextTest("public class Foo {\n" + " public int foo() {\n" + " if (a) {\n" + " return;\n" + " }\n" + " }\n" + "}", "public class Foo\n" + "{\n" + " public int foo()\n" + " {\n" + " if (a)\n" + " {\n" + " return;\n" + " }\n" + " }\n" + "}");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testSpaceAroundField.
public void testSpaceAroundField() throws Exception {
final CommonCodeStyleSettings settings = getSettings();
settings.BLANK_LINES_AROUND_FIELD = 1;
doTextTest("class Foo {\n" + " boolean a;\n" + " {\n" + " if (a) {\n" + " } else {\n" + "\n" + " }\n" + " a = 2;\n" + " }\n" + "}", "class Foo {\n" + " boolean a;\n" + "\n" + " {\n" + " if (a) {\n" + " } else {\n" + "\n" + " }\n" + " a = 2;\n" + " }\n" + "}");
}
Aggregations