Array Initializer formatting support for Apex

Issue #2499 resolved
Adam Stepanek created an issue

Hi Scott, could you please add a support for Array Initializer formatting in Apex Code Style, like it is in Java? Currently there is no such option for Apex so this statement new List<String>{'asd'}; gets formatted like so

new List<String>{
    'asd'
};

which adds so many extra lines. These are the option in Java Code Style.

Comments (3)

  1. Scott Wells repo owner
    • changed status to open

    Hi. In the Apex code formatter, can you please enable Wrapping and Braces | Keep when reformatting | Simple blocks in one line and let me know if that doesn't provide what you're wanting?

  2. Log in to comment