Does metals have Scala 3 formatting support? #2744
-
Hello, It is not clear to me if the latest release of Metals is supposed to be able to format Scala 3 code. For context, I am unfamiliar with Scala ecosystem and am just getting into it. Reasonably experienced with software dev in general. My attempts to make scala 3 code formatting work on my machine have failed. When a file has Scala 2 compatible syntax, it gets formatted. But it fails for syntax that I believe is scala 3 only. For example this content in a file @main def hello: Unit = {
println(msg)
println("Hello !")
}
def msg = "I was compiled by Scala 3. :)" produces this Metals log when format document is executed.
With the following code in the same file instead, formatting does work. object Main extends App {
println("Hello, World!")
} Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@jinalskothari Currently, it doesn't work out of the box and we are going to fix it soon. For now, to make it work you need to specify the latest RC version and |
Beta Was this translation helpful? Give feedback.
@jinalskothari Currently, it doesn't work out of the box and we are going to fix it soon.
For now, to make it work you need to specify the latest RC version and
scala3
dialect in.scalafmt.conf
- see an example