Skip to content

Commit b67e000

Browse files
committed
Remove duplicate conditions
1 parent b2e0132 commit b67e000

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/expr/SqlElParametersBlock.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class SqlElParametersBlock(
7171
return when (childBlock1) {
7272
is SqlElSymbolBlock -> SqlCustomSpacingBuilder.nonSpacing
7373
is SqlElCommaBlock -> SqlCustomSpacingBuilder.normalSpacing
74-
else -> return SqlCustomSpacingBuilder.normalSpacing
74+
else -> return SqlCustomSpacingBuilder.nonSpacing
7575
}
7676
}
7777

src/main/kotlin/org/domaframework/doma/intellij/formatter/block/expr/SqlElPrimaryBlock.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import com.intellij.formatting.Block
1919
import com.intellij.formatting.Spacing
2020
import com.intellij.lang.ASTNode
2121
import org.domaframework.doma.intellij.formatter.block.SqlBlock
22+
import org.domaframework.doma.intellij.formatter.block.SqlLiteralBlock
2223
import org.domaframework.doma.intellij.formatter.block.SqlUnknownBlock
2324
import org.domaframework.doma.intellij.formatter.util.SqlBlockFormattingContext
2425
import org.domaframework.doma.intellij.psi.SqlTypes
@@ -41,8 +42,8 @@ class SqlElPrimaryBlock(
4142
SqlTypes.COMMA ->
4243
SqlElCommaBlock(child, context)
4344

44-
SqlTypes.EL_PRIMARY_EXPR, SqlTypes.EL_NUMBER, SqlTypes.EL_STRING, SqlTypes.BOOLEAN, SqlTypes.EL_NULL ->
45-
SqlElPrimaryBlock(child, context)
45+
SqlTypes.EL_NUMBER, SqlTypes.EL_STRING, SqlTypes.BOOLEAN, SqlTypes.EL_NULL ->
46+
SqlLiteralBlock(child, context)
4647

4748
else -> SqlUnknownBlock(child, context)
4849
}

src/test/testData/sql/formatter/StaticFieldAccess.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ SELECT *
22
FROM configurations
33
WHERE
44
config_key = /*@ com.example.Constants @CONFIG_KEY */'system.timeout'
5-
AND value = /*@ com.example.Utils @ util. getDefaultValue (0) */'30'
5+
AND value = /*@ com.example.Utils @ util. getDefaultValue (0 , "x") */'30'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
SELECT *
22
FROM configurations
33
WHERE config_key = /* @com.example.Constants@CONFIG_KEY */'system.timeout'
4-
AND value = /* @[email protected](0) */'30'
4+
AND value = /* @[email protected](0, "x") */'30'

0 commit comments

Comments
 (0)