Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Fix spacing after while in do-while loops
Browse files Browse the repository at this point in the history
  • Loading branch information
hovinen committed Mar 1, 2021
1 parent 24ed25f commit 786338d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class DoWhileExpressionScanner(private val kotlinScanner: KotlinScanner
)
}
possibleWhitespace()
nodeOfType(KtTokens.WHILE_KEYWORD) thenMapToTokens { listOf(LeafNodeToken(" while(")) }
nodeOfType(KtTokens.WHILE_KEYWORD) thenMapToTokens { listOf(LeafNodeToken(" while (")) }
possibleWhitespace()
nodeOfType(KtTokens.LPAR)
possibleWhitespace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,7 @@ class KotlinFormatterTest {
aMethodWithLambda {
do {
doSomething()
} while(true)
} while (true)
}
""".trimIndent()
)
Expand All @@ -3115,7 +3115,7 @@ class KotlinFormatterTest {
aMethodWithLambda {
do {
doSomething()
} while(true)
} while (true)
}
""".trimIndent()
)
Expand All @@ -3129,7 +3129,7 @@ class KotlinFormatterTest {
"""
do {
doSomething()
} while(true)
} while (true)
""".trimIndent()
)
}
Expand All @@ -3140,15 +3140,15 @@ class KotlinFormatterTest {
"""
do {
doSomething()
} while(true)
} while (true)
""".trimIndent()
)

assertThat(result).isEqualTo(
"""
do {
doSomething()
} while(true)
} while (true)
""".trimIndent()
)
}
Expand Down

0 comments on commit 786338d

Please sign in to comment.