File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
src/main/kotlin/org/domaframework/doma/intellij/formatter/block Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ open class SqlBlock(
8181 private fun calculateChildTextLength (child : SqlBlock ): Int {
8282 val nonCommentChildren = child.childBlocks.filterNot { it is SqlDefaultCommentBlock }
8383
84+ // True only on the first loop iteration when the current element is the first child.
85+ // If the subgroup is empty, return the length of “)”;
86+ // otherwise DEFAULT_TEXT_LENGTH_INCREMENT already adds a space, so “)” needs no extra length.
8487 return when {
8588 nonCommentChildren.isNotEmpty() -> child.getChildrenTextLen() + child.getNodeText().length
8689 isExcludedFromTextLength(child) -> if (childBlocks.firstOrNull() == child) child.getNodeText().length else 0
You can’t perform that action at this time.
0 commit comments