我正在使用帶有 Scala 插件 2022.2.677 的 IntelliJ IDEA 2022.2.2(社區版,Build #IC-222.4167.29)。我想要具有以下樣式的 scala if 陳述句:
class test {
def ifelse(i: Int): String =
if i == 1 then "one"
else if i == 2 then "two"
else if i == 3 then "three"
else "many"
}
但它由 IDEAIJ 格式化如下:
class test {
def ifelse(i: Int): String =
if i == 1 then "one"
else if i == 2 then "two"
else if i == 3 then "three"
else "many"
}
我找不到更改此選項的選項。
uj5u.com熱心網友回復:
嘗試禁用Align if-else statements下的選項Settings/Preferences | Editor | Code Style | Scala | Wrapping and Braces | if() statement
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/510383.html
標籤:if 语句智能理念scala-3
