From b0531b405ecf9cdf38f58199bfa658953e84b20f Mon Sep 17 00:00:00 2001 From: aktsay6 Date: Tue, 16 Feb 2021 10:28:53 +0300 Subject: [PATCH] bugfix/indentation-inside-string-templates(#758) ### What's done: * Fixed bug --- .../org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt index 8ecd8494a7..35b62e78aa 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/Checkers.kt @@ -209,9 +209,9 @@ internal class DotCallChecker(config: IndentationConfig) : CustomIndentationChec type == ELVIS || type == IS_EXPRESSION || type == AS_KEYWORD || type == AS_SAFE } || nextNode.isCommentBeforeDot()) && whiteSpace.parents.none { it.node.elementType == LONG_STRING_TEMPLATE_ENTRY } } - ?.let { - if (it.isFromStringTemplate()) { - val template = it.parents().takeWhile { it.elementType != STRING_TEMPLATE }.last() + ?.let { node -> + if (node.isFromStringTemplate()) { + val template = node.parents().takeWhile { it.elementType != STRING_TEMPLATE }.last() return CheckResult.from(indentError.actual, indentError.expected + (if (configuration.extendedIndentBeforeDot) 2 else 1) * configuration.indentationSize, true) }