I'm looking at the options in IntelliJ IDEA 12 and I can't let this go. So please help me stop wasting time on it.
This is some code from my Build.scala:
val logging =
Seq(
"ch.qos.logback" % "logback-classic" % "1.0.13",
"org.slf4j" % "slf4j-api" % "1.7.5",
"com.weiglewilczek.slf4s" % "slf4s_2.9.1" % "1.0.7"
)
I'd like it to look like this:
val logging =
Seq(
"ch.qos.logback" % "logback-classic" % "1.0.13",
"org.slf4j" % "slf4j-api" % "1.7.5",
"com.weiglewilczek.slf4s" % "slf4s_2.9.1" % "1.0.7"
)
And I prefer create that automatically with the code formatter. In my (unreliable) memory I had this working in IntelliJ IDEA before, but I can't find which options to turn on.
Do you know where this option is hiding?
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. Switch to the Formatter tab and in the Do not format field, enter the files and directories that you want to exclude using a glob pattern. , the field will expand, and each pattern will be shown on a separate line.
Open indentation settings in code style scheme Click the widget and select Configure Indents for 'Language'. In the dialog that opens, you can change settings for tabs and indents and also configure other code style settings. Click OK. Reformat the necessary part of your project to apply new indentation settings.
Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings. You can also display the Reformat File dialog with ⌥⇧⌘L (macOS), or Ctrl+Alt+Shift+L (Windows/Linux).
There are many Align multiline options in IDEA, but none has an effect on this syntax.
This feature is not in IDEA 12. The only option that I could think of was to manually format the code that way. You should vote for this alignment feature request and anxiously await IDEA 13.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With