Add indent before colon of super types list on new line (KT-13981, KT-5117)
#KT-13981 Fixed #KT-5117 Fixed (cherry picked from commit dfea3af)
This commit is contained in:
committed by
Nikolay Krasko
parent
944b9b5b6c
commit
6a72cebe88
@@ -24,13 +24,14 @@ import com.intellij.psi.tree.IElementType
|
||||
import com.intellij.psi.tree.TokenSet
|
||||
import org.jetbrains.kotlin.KtNodeTypes
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings
|
||||
import org.jetbrains.kotlin.idea.formatter.NodeIndentStrategy.strategy
|
||||
import org.jetbrains.kotlin.kdoc.lexer.KDocTokens
|
||||
import org.jetbrains.kotlin.kdoc.parser.KDocElementTypes
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.lexer.KtTokens.*
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.idea.formatter.NodeIndentStrategy.strategy
|
||||
import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings
|
||||
import org.jetbrains.kotlin.kdoc.parser.KDocElementTypes
|
||||
import org.jetbrains.kotlin.lexer.KtTokens.*
|
||||
|
||||
private val QUALIFIED_OPERATION = TokenSet.create(DOT, SAFE_ACCESS)
|
||||
private val KDOC_COMMENT_INDENT = 1
|
||||
@@ -344,6 +345,11 @@ private val INDENT_RULES = arrayOf<NodeIndentStrategy>(
|
||||
.`in`(KtNodeTypes.DOT_QUALIFIED_EXPRESSION, KtNodeTypes.SAFE_ACCESS_EXPRESSION)
|
||||
.set(Indent.getContinuationWithoutFirstIndent(false)),
|
||||
|
||||
strategy("Colon of delegation list")
|
||||
.`in`(KtNodeTypes.CLASS, KtNodeTypes.OBJECT_DECLARATION)
|
||||
.forType(KtTokens.COLON)
|
||||
.set(Indent.getNormalIndent(false)),
|
||||
|
||||
strategy("Delegation list")
|
||||
.`in`(KtNodeTypes.SUPER_TYPE_LIST, KtNodeTypes.INITIALIZER_LIST)
|
||||
.set(Indent.getContinuationIndent(false)),
|
||||
|
||||
Reference in New Issue
Block a user