Skip to content

Commit 2be3aca

Browse files
authored
Merge pull request #156 from domaframework/fix/formatter-line-comment-indent
Fix/formatter line comment indent
2 parents 5b5f561 + 0b83719 commit 2be3aca

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ open class SqlLineCommentBlock(
5555
return it.indent.groupIndentLen.minus(2)
5656
}
5757
}
58-
return 1
58+
return it.indent.indentLen
5959
}
6060
return 1
6161
}

src/test/testData/sql/formatter/FormattedSelect.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ SELECT COUNT(DISTINCT (x))
1515
, ISNULL(s.fiberid
1616
, 0) AS fiberid
1717
FROM phototag p
18+
-- Line1
1819
JOIN usno u
20+
-- Line2
1921
ON p.objid = u.objid
2022
/** Join */
2123
LEFT OUTER JOIN specobj s
@@ -24,9 +26,11 @@ SELECT COUNT(DISTINCT (x))
2426
AND p.plate = s.plate
2527
/** Where */
2628
WHERE p.TYPE = DBO.FPHOTOTYPE('Star')
29+
-- Line3
2730
OR (p.flags & DBO.FPHOTOFLAGS('EDGE') = 0
2831
AND (p.psfmag_g - p.extinction_g) BETWEEN 15 AND 20)
2932
/*%if status == 2 */
33+
-- Line4
3034
AND u.propermotion > 2.
3135
/** And Group */
3236
AND (p.psfmag_g - p.extinction_g + 5 * LOG(u.propermotion / 100.) + 5 > 16.136 + 2.727 * (p.psfmag_g - p.extinction_g - (p.psfmag_i - p.extinction_i))

src/test/testData/sql/formatter/Select.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ SELECT COUNT( DISTINCT (x)),o.*
1515
, 0) AS fiberid
1616

1717
FROM phototag p
18-
18+
-- Line1
1919
JOIN usno u
20-
20+
-- Line2
2121
ON p.objid = u.objid
2222
/** Join */
2323
LEFT OUTER JOIN specobj s
2424
/** ON */
2525
ON p.objid = s.bestobjid AND p.plate = s.plate
2626
/** Where */
2727
WHERE p.TYPE = DBO.FPHOTOTYPE('Star')
28-
28+
-- Line3
2929
OR (p.flags & DBO.FPHOTOFLAGS('EDGE') = 0
3030

3131
AND (p.psfmag_g - p.extinction_g) BETWEEN 15 AND 20)
3232
/*%if status == 2 */
33+
-- Line4
3334
AND u.propermotion > 2.
3435
/** And Group */
3536
AND (p.psfmag_g - p.extinction_g + 5 * LOG(u.propermotion / 100.) + 5 > 16.136 + 2.727 * (p.psfmag_g - p.extinction_g - (p.psfmag_i - p.extinction_i))

0 commit comments

Comments
 (0)