0

Since Scala 3.3 fewerBraces is a standard feature. However, when IDEA 2023.2 (Community Edition) with Scala Plugin 2023.2.19 formats the following code, the result does not compile.

class Foo(i: Int)(s: String)

val fooList: List[Foo] = Foo(42):
  """hi"""
:: Nil

After formatting:

class Foo(i: Int)(s: String)

val fooList: List[Foo] = Foo(42):
  """hi"""
    :: Nil

Am I doing something wrong or is this a bug? How to solve this?

Edit: I found the following workaround.

class Foo(i: Int)(s: String)

// @formatter:off
val fooList: List[Foo] = Foo(42):
  """hi"""
:: Nil
// @formatter:on

Edit: I reported a bug

Marcus
  • 1,857
  • 4
  • 22
  • 44
  • 1
    I'd recommend you discuss this issue with the Scala plugin developers at https://youtrack.jetbrains.com/issues/SCL – Egor Klepikov Aug 11 '23 at 11:22
  • 1
    As @EgorKlepikov said, you can report an issue. Also in the [scala plugin github repo](https://github.com/JetBrains/intellij-scala) they said that you can also ask question in their [discrod channel](https://discord.gg/aUKpZzeHCK) – Gastón Schabas Aug 11 '23 at 15:57

0 Answers0