Search in sources :

Example 21 with CommonCodeStyleSettings

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" + "}");
}
Also used : CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings)

Example 22 with CommonCodeStyleSettings

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");
}
Also used : CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings)

Example 23 with CommonCodeStyleSettings

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");
}
Also used : CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings)

Example 24 with CommonCodeStyleSettings

use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.

the class IndentTest method testBinaryOperation.

public void testBinaryOperation() throws Exception {
    defaultSettings();
    CommonCodeStyleSettings settings = getJavaSettings();
    settings.ALIGN_MULTILINE_BINARY_OPERATION = true;
    doTest("BinaryOperation.java", "BinaryOperation_after.java");
}
Also used : CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings)

Example 25 with CommonCodeStyleSettings

use of com.intellij.psi.codeStyle.CommonCodeStyleSettings in project intellij-community by JetBrains.

the class JavaEnterActionTest method testEnter_AfterLastChainedCall.

public void testEnter_AfterLastChainedCall() throws IOException {
    CodeStyleSettings settings = getCodeStyleSettings();
    CommonCodeStyleSettings javaCommon = settings.getCommonSettings(JavaLanguage.INSTANCE);
    javaCommon.ALIGN_MULTILINE_CHAINED_METHODS = true;
    setCodeStyleSettings(settings);
    doTextTest("java", "class T {\n" + "    public void main() {\n" + "        ActionBarPullToRefresh.from(getActivity())\n" + "                              .theseChildrenArePullable(eventsListView)\n" + "                              .listener(this)\n" + "                              .useViewDelegate(StickyListHeadersListView.class, new AbsListViewDelegate())<caret>\n" + "    }\n" + "}", "class T {\n" + "    public void main() {\n" + "        ActionBarPullToRefresh.from(getActivity())\n" + "                              .theseChildrenArePullable(eventsListView)\n" + "                              .listener(this)\n" + "                              .useViewDelegate(StickyListHeadersListView.class, new AbsListViewDelegate())\n" + "                              <caret>\n" + "    }\n" + "}");
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings) CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings)

Aggregations

CommonCodeStyleSettings (com.intellij.psi.codeStyle.CommonCodeStyleSettings)202 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)19 TextRange (com.intellij.openapi.util.TextRange)5 PsiElement (com.intellij.psi.PsiElement)5 ASTNode (com.intellij.lang.ASTNode)4 Editor (com.intellij.openapi.editor.Editor)4 JavaCodeStyleSettings (com.intellij.psi.codeStyle.JavaCodeStyleSettings)4 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)3 PsiFile (com.intellij.psi.PsiFile)3 File (java.io.File)3 Matcher (java.util.regex.Matcher)3 NonNls (org.jetbrains.annotations.NonNls)3 NotNull (org.jetbrains.annotations.NotNull)3 Document (com.intellij.openapi.editor.Document)2 Project (com.intellij.openapi.project.Project)2 CodeStyleManager (com.intellij.psi.codeStyle.CodeStyleManager)2 ArrangementGroupingRule (com.intellij.psi.codeStyle.arrangement.group.ArrangementGroupingRule)2 IElementType (com.intellij.psi.tree.IElementType)2 Nullable (org.jetbrains.annotations.Nullable)2 GroovyCodeStyleSettings (org.jetbrains.plugins.groovy.codeStyle.GroovyCodeStyleSettings)2