Apex Code Style: Continutation Indent acting as if 4 regardless of config

Issue #1292 resolved
Jonny Power (he/him) created an issue

It used to be possible to define a continuation indent under the Apex code style config. When setting this now, the configured setting does not apply to the example code in the right pane (or when code is formatted in IntelliJ) - regardless of the setting the continuation indent is set to 4.

2019-04-29_9-54-10.png

IntelliJ IDEA 2019.1 (Ultimate Edition) Build #IU-191.6183.87, built on March 26, 2019 JRE: 1.8.0_202-release-1483-b39 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

IC2: 2.0.5.9

Comments (2)

  1. Scott Wells repo owner

    Hmmmm...I just tried and continuation indents in general are respected properly, e.g.:

    ContinuationIndent.gif

    The issue, I think, is that initializers are treated like blocks and not statement continuations. However, it doesn't look like IC's formatter is 100% consistent about what it considers a block because in the image above, the contents of a SOQL query are treated as a continuation and not a block.

    I also just checked Java's formatter and it does in fact treat initializers--in this case array initializers--as statement continuations.

    I have to be very careful here because I don't want to release an update to the formatter that will suddenly change existing code that's already been formatted. Let me think about how to roll this out as another configurable option so things continue to work as they do today, but you can configure it to work as you're wanting as well.

  2. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  3. Log in to comment