use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class IndentTest method testTernaryOperation.
public void testTernaryOperation() throws Exception {
defaultSettings();
CommonCodeStyleSettings settings = getJavaSettings();
settings.ALIGN_MULTILINE_TERNARY_OPERATION = true;
doTest("TernaryOperation.java", "TernaryOperation_after.java");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class DetectIndentAndTypeTest method testWhenTabsDetected_SetIndentSizeToTabSize.
public void testWhenTabsDetected_SetIndentSizeToTabSize() {
CommonCodeStyleSettings common = mySettings.getCommonSettings(JavaLanguage.INSTANCE);
CommonCodeStyleSettings.IndentOptions indentOptions = common.getIndentOptions();
assert indentOptions != null;
indentOptions.INDENT_SIZE = 1;
indentOptions.TAB_SIZE = 2;
myFixture.configureByText(JavaFileType.INSTANCE, "public class T {\n" + "\tvoid run() {\n" + "\t\tint a = 2;<caret>\n" + "\t}\n" + "}\n");
myFixture.type('\n');
myFixture.checkResult("public class T {\n" + "\tvoid run() {\n" + "\t\tint a = 2;\n" + "\t\t<caret>\n" + "\t}\n" + "}\n");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class DetectIndentAndTypeTest method testContinuationTabs_AsDoubleTabSize.
public void testContinuationTabs_AsDoubleTabSize() {
CommonCodeStyleSettings common = mySettings.getCommonSettings(JavaLanguage.INSTANCE);
mySettings.ALIGN_MULTILINE_BINARY_OPERATION = false;
CommonCodeStyleSettings.IndentOptions indentOptions = common.getIndentOptions();
assert indentOptions != null;
indentOptions.TAB_SIZE = 2;
indentOptions.INDENT_SIZE = 2;
indentOptions.CONTINUATION_INDENT_SIZE = 4;
myFixture.configureByText(JavaFileType.INSTANCE, myText);
myFixture.type('\n');
myFixture.checkResult("public class T {\n" + "\tvoid run() {\n" + "\t\tint t = 1 + \n" + "\t\t\t\t2;\n" + "\t}\n" + "}");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class IndentTest method testDoNotIndentTopLevelClassMembers.
public void testDoNotIndentTopLevelClassMembers() throws Exception {
defaultSettings();
CommonCodeStyleSettings settings = getJavaSettings();
settings.DO_NOT_INDENT_TOP_LEVEL_CLASS_MEMBERS = true;
doTest("DoNotIndentTopLevelClassMembers.java", "DoNotIndentTopLevelClassMembers_after.java");
}
use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.
the class IndentTest method testImplementsList2.
public void testImplementsList2() throws Exception {
defaultSettings();
CommonCodeStyleSettings settings = getJavaSettings();
settings.ALIGN_MULTILINE_EXTENDS_LIST = true;
doTest("ImplementsList2.java", "ImplementsList2_after.java");
}
Aggregations