Skip to content

-indent -rewrite breaks code blocks  #10986

Open
@vincenzobaz

Description

@vincenzobaz

Minimized code

@main def hello: Unit =
  {
    val x = 3
    println(x)
  }
  {
    val x = 5
    println(x)
  }

with -indent -rewrite becomes

@main def hello: Unit =
    val x = 3
    println(x)

    val x = 5
    println(x)
  println("lol")

which is not valid code

Expectation

  • These braces should not be removed (it is not a def/val/class/object ...)
  • If the braces are removed, indentation should be corrected

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions