LineIndentProvider: add options for parentheses
Part of #KT-22211 Part of #KT-39353
This commit is contained in:
+9
-1
@@ -5,4 +5,12 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.formatter.lineIndent
|
||||
|
||||
interface KotlinIndentationAdjuster
|
||||
interface KotlinIndentationAdjuster {
|
||||
// ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
val alignWhenMultilineFunctionParentheses: Boolean
|
||||
get() = false
|
||||
|
||||
// ALIGN_MULTILINE_BINARY_OPERATION
|
||||
val alignWhenMultilineBinaryExpression: Boolean
|
||||
get() = false
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.formatter
|
||||
|
||||
import com.intellij.application.options.CodeStyle
|
||||
import com.intellij.lang.Language
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
@@ -20,7 +21,13 @@ class KotlinLineIndentProvider : KotlinLikeLangLineIndentProvider() {
|
||||
super.getLineIndent(project, editor, language, offset)
|
||||
|
||||
override fun indentionSettings(project: Project): KotlinIndentationAdjuster = object : KotlinIndentationAdjuster {
|
||||
val settings = CodeStyle.getSettings(project)
|
||||
|
||||
override val alignWhenMultilineFunctionParentheses: Boolean
|
||||
get() = settings.kotlinCommonSettings.ALIGN_MULTILINE_METHOD_BRACKETS
|
||||
|
||||
override val alignWhenMultilineBinaryExpression: Boolean
|
||||
get() = settings.kotlinCommonSettings.ALIGN_MULTILINE_BINARY_OPERATION
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user