use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-plugins by JetBrains.
the class DartFormatterTest method testExpressions.
public void testExpressions() throws Exception {
final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
settings.RIGHT_MARGIN = 40;
// TODO Decide whether this should be the default -- risky!
settings.KEEP_LINE_BREAKS = false;
doTest();
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-plugins by JetBrains.
the class DartFormatterTest method testWrappingMeth.
public void testWrappingMeth() throws Exception {
final CommonCodeStyleSettings settings = getSettings(DartLanguage.INSTANCE);
settings.METHOD_ANNOTATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE = true;
settings.METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE = true;
settings.CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.CALL_PARAMETERS_LPAREN_ON_NEXT_LINE = true;
settings.CALL_PARAMETERS_RPAREN_ON_NEXT_LINE = true;
settings.ELSE_ON_NEW_LINE = true;
settings.SPECIAL_ELSE_IF_TREATMENT = true;
settings.FOR_STATEMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.FOR_STATEMENT_LPAREN_ON_NEXT_LINE = true;
settings.FOR_STATEMENT_RPAREN_ON_NEXT_LINE = true;
settings.WHILE_ON_NEW_LINE = true;
settings.CATCH_ON_NEW_LINE = true;
settings.BINARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.BINARY_OPERATION_SIGN_ON_NEXT_LINE = true;
settings.PARENTHESES_EXPRESSION_LPAREN_WRAP = true;
settings.PARENTHESES_EXPRESSION_RPAREN_WRAP = true;
settings.ASSIGNMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE = true;
settings.TERNARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
settings.TERNARY_OPERATION_SIGNS_ON_NEXT_LINE = true;
settings.BLOCK_COMMENT_AT_FIRST_COLUMN = true;
settings.KEEP_LINE_BREAKS = true;
doTest();
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-plugins by JetBrains.
the class ActionScriptFormatterTest method testBlankLinesAfterPackage.
public void testBlankLinesAfterPackage() throws Exception {
final CommonCodeStyleSettings settings = getEcma4Settings();
int blankLines = settings.BLANK_LINES_AFTER_PACKAGE;
settings.BLANK_LINES_AFTER_PACKAGE = 2;
doTest("package {\n" + "import com.jetbrains.flex.Demo;\n" + "import com.jetbrains.flex.Sample;\n" + "class Foo {\n" + "}\n" + "}", "package {\n" + "\n" + "\n" + "import com.jetbrains.flex.Demo;\n" + "import com.jetbrains.flex.Sample;\n" + "\n" + "class Foo {\n" + "}\n" + "}", ".as");
settings.BLANK_LINES_AFTER_PACKAGE = blankLines;
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-plugins by JetBrains.
the class ActionScriptFormatterTest method testActionScriptClass.
public void testActionScriptClass() throws Exception {
CommonCodeStyleSettings settings = getEcma4Settings();
settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
settings.CLASS_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
doTest("package foo { class A { function foo() {} } }", "package foo\n" + "{\n" + "class A\n" + "{\n" + " function foo()\n" + " {\n" + " }\n" + "}\n" + "}", "js2");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-plugins by JetBrains.
the class ActionScriptFormatterTest method testAlignOperations.
public void testAlignOperations() throws Exception {
final CommonCodeStyleSettings styleSettings = getEcma4Settings();
styleSettings.ALIGN_MULTILINE_EXTENDS_LIST = true;
doTest("class _X extends X, \n Y implements Z,\n T {}", "class _X extends X,\n" + " Y implements Z,\n" + " T {\n" + "}", JavaScriptSupportLoader.ECMA_SCRIPT_L4_FILE_EXTENSION2);
}
Aggregations