@@ -69,7 +69,7 @@ class SqlElConditionLoopCommentBlock(
6969 companion object {
7070 private const val DIRECTIVE_INDENT_STEP = 2
7171 private const val DEFAULT_INDENT_OFFSET = 1
72-
72+
7373 private val LINE_BREAK_PARENT_TYPES =
7474 listOf (
7575 SqlSubGroupBlock ::class ,
@@ -273,11 +273,14 @@ class SqlElConditionLoopCommentBlock(
273273 }
274274
275275 fun checkConditionLoopDirectiveParentBlock (block : SqlBlock ): Boolean = isBeforeParentBlock() && parentBlock == block
276-
277- private fun calculateSubGroupBlockIndent (parent : SqlSubGroupBlock , openDirectiveCount : Int ): Int {
276+
277+ private fun calculateSubGroupBlockIndent (
278+ parent : SqlSubGroupBlock ,
279+ openDirectiveCount : Int ,
280+ ): Int {
278281 val parentGroupIndentLen = parent.indent.groupIndentLen
279282 val grand = parent.parentBlock
280-
283+
281284 grand?.let { grandParent ->
282285 when (grandParent) {
283286 is SqlCreateKeywordGroupBlock -> {
@@ -292,23 +295,23 @@ class SqlElConditionLoopCommentBlock(
292295 }
293296 }
294297 }
295-
298+
296299 return if (shouldNotIndent(parent)) {
297300 parentGroupIndentLen.plus(openDirectiveCount * DIRECTIVE_INDENT_STEP )
298301 } else {
299302 parentGroupIndentLen.plus(openDirectiveCount * DIRECTIVE_INDENT_STEP ).plus(DEFAULT_INDENT_OFFSET )
300303 }
301304 }
302-
305+
303306 private fun calculatePreviousTextLength (parent : SqlSubGroupBlock ): Int {
304307 var prevTextLen = DEFAULT_INDENT_OFFSET
305308 parent.prevChildren?.dropLast(1 )?.forEach { prev ->
306309 prevTextLen = prevTextLen.plus(prev.getNodeText().length)
307310 }
308311 return prevTextLen
309312 }
310-
313+
311314 private fun shouldNotIndent (parent : SqlSubGroupBlock ): Boolean =
312315 TypeUtil .isExpectedClassType(SqlRightPatternBlock .NOT_INDENT_EXPECTED_TYPES , parent) ||
313- parent is SqlWithCommonTableGroupBlock
316+ parent is SqlWithCommonTableGroupBlock
314317}
0 commit comments