diff --git a/src/main/kotlin/org/domaframework/doma/intellij/formatter/processor/SqlFormatPreProcessor.kt b/src/main/kotlin/org/domaframework/doma/intellij/formatter/processor/SqlFormatPreProcessor.kt index 19bb0351..7c6ae9a4 100644 --- a/src/main/kotlin/org/domaframework/doma/intellij/formatter/processor/SqlFormatPreProcessor.kt +++ b/src/main/kotlin/org/domaframework/doma/intellij/formatter/processor/SqlFormatPreProcessor.kt @@ -93,23 +93,7 @@ class SqlFormatPreProcessor : PreFormatProcessor { } SqlTypes.LEFT_PAREN -> { - newKeyword = - if (createQueryType == CreateQueryType.TABLE) { - getNewLineString(it.prevSibling, getUpperText(it)) - } else if (keywordIndex > 0) { - if (listOf( - "insert", - "into", - "all", - ).contains(replaceKeywordList[keywordIndex - 1].text.lowercase()) - ) { - getNewLineString(it.prevSibling, getUpperText(it)) - } else { - getUpperText(it) - } - } else { - getUpperText(it) - } + newKeyword = getNewLineString(it.prevSibling, getUpperText(it)) } SqlTypes.RIGHT_PAREN -> { diff --git a/src/test/testData/sql/formatter/WithUnionAll.sql b/src/test/testData/sql/formatter/WithUnionAll.sql index f513684a..306b6c61 100644 --- a/src/test/testData/sql/formatter/WithUnionAll.sql +++ b/src/test/testData/sql/formatter/WithUnionAll.sql @@ -1,7 +1,7 @@ -with tables AS ( ( SELECT top, no_pre_as AS AS_NAME, pre_as, clm3 from demo +with tables AS (( SELECT top, no_pre_as AS AS_NAME, pre_as, clm3 from demo WHERE id = /*# "block" */ ) UNION ALL ( SELECT id2, no_pre_as2 AS AS_NAME2, pre_as2 FROM demo2 - WHERE id2 = /*# "block2" */ ) ) + WHERE id2 = /*# "block2" */ )) SELECT query.id3 , query.no_pre_as3 AS AS_NAME3 , query.pre_as3