0

I've started using Visual Studio (solely for work) and found out, that VS aligns method chains into the same column:

                  |
                  |
                  v
var x = Enumerable.Range(0, 10)
                  .Where(x => x % 2 == 0)
                  .Select(x => x * x)
                  .ToList()

For uni and my private projects however, I only use JetBrains products and wondered whether there is a similar option in code styling so method chains in Java are aligned like shown above as well.

// So instead of this (which is the default setting in JetBrains IDEs)
final var x = IntStream.range(0, 11)
        .filter((x) -> x % 2 == 0)
        .map((x) -> x * x)
        .collect(Collectors.toList())

// I would like to have this
final var x = IntStream.range(0, 11)
                       .filter((x) -> x % 2 == 0)
                       .map((x) -> x * x)
                       .collect(Collectors.toList())

I have already dug through the entire Code Style tab in IntelliJ's settings several times, without any mentionable success though.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
devcayed
  • 37
  • 6

0 Answers0