diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt index dac3d0e0b9b..351bab002df 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KotlinCommonBlock.kt @@ -46,12 +46,6 @@ private val CODE_BLOCKS = TokenSet.create(KtNodeTypes.BLOCK, KtNodeTypes.CLASS_B private val ALIGN_FOR_BINARY_OPERATIONS = TokenSet.create(MUL, DIV, PERC, PLUS, MINUS, ELVIS, LT, GT, LTEQ, GTEQ, ANDAND, OROR) private val ANNOTATIONS = TokenSet.create(KtNodeTypes.ANNOTATION_ENTRY, KtNodeTypes.ANNOTATION) -val CodeStyleSettings.kotlinCommonSettings: KotlinCommonCodeStyleSettings - get() = getCommonSettings(KotlinLanguage.INSTANCE) as KotlinCommonCodeStyleSettings - -val CodeStyleSettings.kotlinCustomSettings: KotlinCodeStyleSettings - get() = getCustomSettings(KotlinCodeStyleSettings::class.java)!! - typealias WrappingStrategy = (childElement: ASTNode) -> Wrap? fun noWrapping(childElement: ASTNode): Wrap? = null diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KtCodeStyleSettings.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KtCodeStyleSettings.kt index 443dfb7b614..1594c4a8c93 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KtCodeStyleSettings.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/formatter/KtCodeStyleSettings.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.idea.formatter import com.intellij.openapi.project.Project +import com.intellij.psi.codeStyle.CodeStyleSettings import com.intellij.psi.codeStyle.CodeStyleSettingsManager import org.jetbrains.kotlin.idea.KotlinLanguage import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings @@ -32,4 +33,10 @@ fun ktCodeStyleSettings(project: Project): KtCodeStyleSettings? { val ktCustomSettings = settings.getCustomSettings(KotlinCodeStyleSettings::class.java) return KtCodeStyleSettings(ktCustomSettings, ktCommonSettings) -} \ No newline at end of file +} + +val CodeStyleSettings.kotlinCommonSettings: KotlinCommonCodeStyleSettings + get() = getCommonSettings(KotlinLanguage.INSTANCE) as KotlinCommonCodeStyleSettings + +val CodeStyleSettings.kotlinCustomSettings: KotlinCodeStyleSettings + get() = getCustomSettings(KotlinCodeStyleSettings::class.java) \ No newline at end of file