Skip to content

Commit

Permalink
fix orElseFail inspection on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
myazinn committed Nov 30, 2023
1 parent 563e5b5 commit 89b37e3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ object OrElseFailSimplificationType extends SimplificationType {

override def getSimplification(expr: ScExpression): Option[Simplification] = {
def blockReplacement(zio: ScExpression, body: Seq[ScBlockStatement]): Simplification = {
val separator = System.lineSeparator
// new Intellij version doesn't seem to like Windows line separators
// if ScalaPsiElementFactory.createBlockWithGivenExpressions can use "\n", so can we
val separator = "\n"
val blockBody = body.map(_.getText).mkString(separator, separator, separator)
replace(expr).withText(s"${zio.getText}.$replaceWith {$blockBody}")
}
Expand Down

0 comments on commit 89b37e3

Please sign in to comment.