@@ -18,7 +18,6 @@ package org.domaframework.doma.intellij.formatter.handler
1818import com.intellij.lang.ASTNode
1919import org.domaframework.doma.intellij.formatter.block.SqlBlock
2020import org.domaframework.doma.intellij.formatter.block.SqlCommaBlock
21- import org.domaframework.doma.intellij.formatter.block.comment.SqlElConditionLoopCommentBlock
2221import org.domaframework.doma.intellij.formatter.block.conflict.SqlConflictClauseBlock
2322import org.domaframework.doma.intellij.formatter.block.conflict.SqlConflictExpressionSubGroupBlock
2423import org.domaframework.doma.intellij.formatter.block.group.keyword.condition.SqlConditionKeywordGroupBlock
@@ -46,19 +45,17 @@ object NotQueryGroupHandler {
4645 lastGroup : SqlBlock ? ,
4746 child : ASTNode ,
4847 sqlBlockFormattingCtx : SqlBlockFormattingContext ,
49- groups : List <SqlBlock >,
5048 ): SqlBlock ? =
5149 when {
5250 hasInKeyword(lastGroup) -> SqlParallelListBlock (child, sqlBlockFormattingCtx)
53- lastGroupParentConditionKeywordGroup(groups ) -> createConditionalExpressionGroup(child, sqlBlockFormattingCtx)
51+ lastGroupParentConditionKeywordGroup(lastGroup ) -> createConditionalExpressionGroup(child, sqlBlockFormattingCtx)
5452 hasFunctionOrAliasContext(lastGroup) -> createFunctionOrValueBlock(lastGroup, child, sqlBlockFormattingCtx)
5553 lastGroup is SqlConflictClauseBlock -> SqlConflictExpressionSubGroupBlock (child, sqlBlockFormattingCtx)
5654 hasValuesContext(lastGroup) -> SqlValuesParamGroupBlock (child, sqlBlockFormattingCtx)
5755 else -> null
5856 }
5957
60- private fun lastGroupParentConditionKeywordGroup (groups : List <SqlBlock >): Boolean =
61- groups.lastOrNull { it !is SqlElConditionLoopCommentBlock } is SqlConditionKeywordGroupBlock
58+ private fun lastGroupParentConditionKeywordGroup (lastGroup : SqlBlock ? ): Boolean = lastGroup is SqlConditionKeywordGroupBlock
6259
6360 /* *
6461 * Creates a keyword group block for specific keywords.
0 commit comments