From 17b88a28a05eea63b14d51b62f4aa8db522b52c4 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 8 Aug 2018 15:17:55 +0300 Subject: [PATCH] Utility for detection if new code style is set by default (KT-23400) Need this because some code should work differently before and after applying new Kotlin code style defaults. --- .../src/org/jetbrains/kotlin/idea/util/FormatterUtil.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/idea/formatter/src/org/jetbrains/kotlin/idea/util/FormatterUtil.kt b/idea/formatter/src/org/jetbrains/kotlin/idea/util/FormatterUtil.kt index 7d8caf616d0..8bad96bd09f 100644 --- a/idea/formatter/src/org/jetbrains/kotlin/idea/util/FormatterUtil.kt +++ b/idea/formatter/src/org/jetbrains/kotlin/idea/util/FormatterUtil.kt @@ -6,8 +6,14 @@ package org.jetbrains.kotlin.idea.util import com.intellij.formatting.ASTBlock +import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings /* * ASTBlock is nullable since 182, this extension was introduced to minimize changes between bunches */ -fun ASTBlock.requireNode() = node ?: error("ASTBlock.getNode() returned null") \ No newline at end of file +fun ASTBlock.requireNode() = node ?: error("ASTBlock.getNode() returned null") + +/** + * Can be removed with all usages after moving master to 1.3 with new default code style settings. + */ +val isDefaultOfficialCodeStyle by lazy { !KotlinCodeStyleSettings.DEFAULT.CONTINUATION_INDENT_FOR_CHAINED_CALLS } \ No newline at end of file