When formatting multiline statements in IntelliJ IDEA, can I align operators?
Asked Answered
A

1

6

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?

Andee answered 4/6, 2013 at 8:40 Comment(2)
Duplicate of #15001903 – don't forget to vote on the feature requestReenareenforce
I think it's related, but not necessarily a duplicate (if I understand the scala compilation process correctly). @Reenareenforce this means the option isn't there right?Andee
A
1

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.

Andee answered 12/8, 2013 at 7:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.