Option for normal indent in supertype lists

#KT-21527 Fixed
This commit is contained in:
Dmitry Jemerov
2017-11-30 12:05:58 +01:00
parent 67cd4ed17a
commit 389729cc50
7 changed files with 33 additions and 1 deletions
@@ -43,6 +43,7 @@ public class KotlinCodeStyleSettings extends CustomCodeStyleSettings {
public boolean CONTINUATION_INDENT_IN_PARAMETER_LISTS = true;
public boolean CONTINUATION_INDENT_FOR_EXPRESSION_BODIES = true;
public boolean CONTINUATION_INDENT_FOR_CHAINED_CALLS = true;
public boolean CONTINUATION_INDENT_IN_SUPERTYPE_LISTS = true;
public int BLANK_LINES_AROUND_BLOCK_WHEN_BRANCHES = 0;
public KotlinCodeStyleSettings(CodeStyleSettings container) {
@@ -494,7 +494,12 @@ private val INDENT_RULES = arrayOf<NodeIndentStrategy>(
strategy("Delegation list")
.within(KtNodeTypes.SUPER_TYPE_LIST, KtNodeTypes.INITIALIZER_LIST)
.set(Indent.getContinuationIndent(false)),
.set { settings ->
if (settings.kotlinSettings.CONTINUATION_INDENT_IN_SUPERTYPE_LISTS)
Indent.getContinuationIndent(false)
else
Indent.getNormalIndent()
},
strategy("Indices")
.within(KtNodeTypes.INDICES)