Skip to content

Commit

Permalink
Support RangeUntil operator
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchdukeTim committed Jan 22, 2024
1 parent 494d53b commit ac9884e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ class KotlinInputAstVisitor(
val isFirst = leftExpression === leftMostExpression

when (leftExpression.operationToken) {
KtTokens.RANGE -> {
KtTokens.RANGE, KtTokens.RANGE_UNTIL -> {
if (isFirst) {
builder.open(expressionBreakIndent)
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/test/java/com/facebook/ktfmt/format/FormatterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ class FormatterTest {
| "The" +
| "quick" +
| ("brown".."fox") +
| ("brown"..<"fox") +
| "jumps" +
| "over" +
| "the".."lazy" + "dog"
Expand Down Expand Up @@ -1696,6 +1697,7 @@ class FormatterTest {
| in a..3 -> print()
| in 1..b -> print()
| !in 1..b -> print()
| in 1..<b -> print()
| else -> print(3)
| }
|}
Expand Down

0 comments on commit ac9884e

Please sign in to comment.