File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
src/main/kotlin/org/domaframework/doma/intellij/formatter Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -462,6 +462,10 @@ open class SqlFileBlock(
462462 val childBlock1: SqlBlock ? = child1 as ? SqlBlock
463463 val childBlock2: SqlBlock = child2 as SqlBlock
464464
465+ if (childBlock1 == null ) {
466+ return SqlCustomSpacingBuilder .nonSpacing
467+ }
468+
465469 // The end of a line comment element is a newline, so just add a space for the indent.
466470 if (childBlock1 is SqlLineCommentBlock ) {
467471 return SqlCustomSpacingBuilder ().getSpacing(childBlock2)
Original file line number Diff line number Diff line change 1+ package org.domaframework.doma.intellij.formatter.block.group.keyword.top
2+
3+ import com.intellij.lang.ASTNode
4+ import org.domaframework.doma.intellij.formatter.util.SqlBlockFormattingContext
5+
6+ class SqlTableModificationKeyword (node : ASTNode , context : SqlBlockFormattingContext )
7+ : SqlTopQueryGroupBlock (
8+ node,context
9+ ) {
10+ }
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ import org.domaframework.doma.intellij.formatter.block.group.keyword.second.SqlW
5454import org.domaframework.doma.intellij.formatter.block.group.keyword.top.SqlDeleteQueryGroupBlock
5555import org.domaframework.doma.intellij.formatter.block.group.keyword.top.SqlJoinQueriesGroupBlock
5656import org.domaframework.doma.intellij.formatter.block.group.keyword.top.SqlSelectQueryGroupBlock
57+ import org.domaframework.doma.intellij.formatter.block.group.keyword.top.SqlTableModificationKeyword
5758import org.domaframework.doma.intellij.formatter.block.group.keyword.update.SqlUpdateQueryGroupBlock
5859import org.domaframework.doma.intellij.formatter.block.group.keyword.update.SqlUpdateSetGroupBlock
5960import org.domaframework.doma.intellij.formatter.block.group.keyword.with.SqlWithCommonTableGroupBlock
@@ -195,12 +196,12 @@ class SqlBlockGenerator(
195196 sqlBlockFormattingCtx,
196197 )
197198
198- else ->
199- SqlKeywordGroupBlock (
199+ else -> {
200+ SqlTableModificationKeyword (
200201 child,
201- indentLevel,
202202 sqlBlockFormattingCtx,
203203 )
204+ }
204205 }
205206 }
206207
You can’t perform that action at this time.
0 commit comments