We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please paste the contents of your .scalafmt.conf file here:
.scalafmt.conf
version = 3.7.14 runner.dialect = scala3
When I run scalafmt via CLI like this: scalafmt foo.scala
scalafmt foo.scala
Given try / catch without braces
//> using scala 3.3.1 @main def foo(): Unit = try val x = 3 / 0 catch case e: Throwable => println(s"Caught: ${e.getMessage}")
Scalafmt removes the newlines / indent after try and catch:
try
catch
This doesn't compile anymore.
I would like the formatted output to be unchanged:
as this compiles and run fine.
The text was updated successfully, but these errors were encountered:
I'm still seeing this in 3.7.15 and 3.7.17. My code looks like:
//> using scala 3.3.1 @main def foo(): Unit = try val x = 3 / 0 catch case e: Throwable => println(s"Caught: ${e.getMessage}") finally val _ = 5
And scalafmt wants to do this:
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Configuration (required)
Please paste the contents of your
.scalafmt.conf
file here:Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt foo.scala
Steps
Given try / catch without braces
Problem
Scalafmt removes the newlines / indent after
try
andcatch
:This doesn't compile anymore.
Expectation
I would like the formatted output to be unchanged:
as this compiles and run fine.
The text was updated successfully, but these errors were encountered: