Minor: move methods
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
val CodeStyleSettings.kotlinCommonSettings: KotlinCommonCodeStyleSettings
|
||||
get() = getCommonSettings(KotlinLanguage.INSTANCE) as KotlinCommonCodeStyleSettings
|
||||
|
||||
val CodeStyleSettings.kotlinCustomSettings: KotlinCodeStyleSettings
|
||||
get() = getCustomSettings(KotlinCodeStyleSettings::class.java)
|
||||
Reference in New Issue
Block a user