void () { CodeStyleSettings settings = getCodeStyleSettings(); final CommonCodeStyleSettings.IndentOptions indentOptions = settings.getIndentOptions(JavaFileType.INSTANCE); indentOptions.USE_TAB_CHARACTER = true; indentOptions.SMART_TABS = true; indentOptions.TAB_SIZE = 2; indentOptions.INDENT_SIZE = 2; indentOptions.CONTINUATION_INDENT_SIZE = 8; settings.getCommonSettings(JavaLanguage.INSTANCE).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true; String text = """ class Foo { \tint \t\t\t\t\tmyField; \tvoid foo (int i, \t int j ) { \t}}"""; PsiFileFactory factory = PsiFileFactory.getInstance(PsiManager.getInstance(getProject()).getProject()); final PsiFile file = factory.createFileFromText("a.java", JavaFileType.INSTANCE, text, LocalTimeCounter.currentTime(), true); doGetIndentTest(file, 2, "\t\t\t\t\t"); doGetIndentTest(file, 4, "\t"); doGetIndentTest(file, 6, "\t "); }