@@ -32,6 +32,7 @@ import org.domaframework.doma.intellij.formatter.block.comment.SqlDefaultComment
3232import org.domaframework.doma.intellij.formatter.block.comment.SqlElBlockCommentBlock
3333import org.domaframework.doma.intellij.formatter.block.comment.SqlElConditionLoopCommentBlock
3434import org.domaframework.doma.intellij.formatter.block.comment.SqlLineCommentBlock
35+ import org.domaframework.doma.intellij.formatter.block.expr.SqlElAtSignBlock
3536import org.domaframework.doma.intellij.formatter.block.expr.SqlElSymbolBlock
3637import org.domaframework.doma.intellij.formatter.block.group.SqlNewGroupBlock
3738import org.domaframework.doma.intellij.formatter.block.group.column.SqlColumnBlock
@@ -519,7 +520,7 @@ open class SqlFileBlock(
519520 return SqlCustomSpacingBuilder ().getSpacing(childBlock2)
520521 }
521522
522- if (childBlock2 is SqlOtherBlock ) {
523+ if (childBlock1 !is SqlElSymbolBlock && childBlock1 !is SqlOtherBlock && childBlock2 is SqlOtherBlock ) {
523524 return SqlCustomSpacingBuilder ().getSpacing(childBlock2)
524525 }
525526
@@ -578,6 +579,16 @@ open class SqlFileBlock(
578579 return SqlCustomSpacingBuilder .normalSpacing
579580 }
580581
582+ if (childBlock1 is SqlElSymbolBlock && childBlock2 is SqlElSymbolBlock ||
583+ childBlock1 is SqlElAtSignBlock && childBlock2 is SqlElSymbolBlock ||
584+ childBlock1 is SqlOtherBlock && childBlock2 is SqlElSymbolBlock ||
585+ childBlock1 is SqlElSymbolBlock && childBlock2 is SqlElAtSignBlock ||
586+ childBlock1 is SqlOtherBlock && childBlock2 is SqlOtherBlock ||
587+ childBlock1 is SqlElSymbolBlock && childBlock2 is SqlOtherBlock
588+ ) {
589+ return SqlCustomSpacingBuilder .nonSpacing
590+ }
591+
581592 val spacing: Spacing ? = customSpacingBuilder?.getCustomSpacing(childBlock1, childBlock2)
582593 return spacing ? : spacingBuilder.getSpacing(this , childBlock1, childBlock2)
583594 }
0 commit comments