Add blank lines tab to Kotlin code style UI with two basic options

KEEP_BLANK_LINES_IN_CODE
KEEP_BLANK_LINES_IN_DECLARATIONS

#KT-15504 In Progress
This commit is contained in:
Nikolay Krasko
2017-02-22 20:02:26 +03:00
parent bc90d52873
commit 6b62686019
2 changed files with 43 additions and 1 deletions
@@ -58,6 +58,7 @@ public class KotlinCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
addIndentOptionsTab(settings);
addSpacesTab(settings);
addWrappingAndBracesTab(settings);
addBlankLinesTab(settings);
addTab(new ImportSettingsPanelWrapper(settings));
}
};
@@ -74,7 +74,41 @@ public class KotlinLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSe
" B\n" +
"}\n" +
"";
case BLANK_LINES_SETTINGS:
return
"class Foo {\n" +
" private var field1: Int = 1\n" +
" private val field2: String? = null\n" +
"\n" +
"\n" +
" init {\n" +
" field1 = 2;\n" +
" }\n" +
"\n" +
" fun foo1() {\n" +
" run {\n" +
" \n" +
" \n" +
" \n" +
" field1\n" +
" }\n" +
" }\n" +
"\n" +
"\n" +
" class InnerClass {\n" +
" }\n" +
"}\n" +
"\n" +
"\n" +
"\n" +
"class AnotherClass {\n" +
"}\n" +
"\n" +
"interface TestInterface {\n" +
"}\n" +
"fun run(f: () -> Unit) {\n" +
" f()\n" +
"}";
default:
return
"open class Some {\n"+
@@ -181,8 +215,15 @@ public class KotlinLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSe
"Put left brace on new line",
CodeStyleSettingsCustomizable.WRAPPING_BRACES);
break;
case BLANK_LINES_SETTINGS:
consumer.showStandardOptions(
"KEEP_BLANK_LINES_IN_CODE",
"KEEP_BLANK_LINES_IN_DECLARATIONS"
);
break;
default:
consumer.showStandardOptions();
break;
}
}