Add a code formatter option to place each selected field on a separate line

Issue #547 resolved
Scott Wells repo owner created an issue

This was requested by a user. Basically add a formatter option to reformat:

SELECT Id, Name, LastModifiedDate
FROM Account

as:

SELECT Id, 
    Name, 
    LastModifiedDate
FROM Account

I imagine it'll also need options for where the comma should appear and perhaps whether fields should be aligned in the same column.

Comments (6)

  1. Scott Wells reporter

    I've just submitted a new formatting option, SOQL>'SELECT' items, with options Do nothing, End of line, and Next line that controls how the SELECT list is formatted. There are two other options I will likely add here in time, one to specify whether the entire SELECT list should be on a new line or not (which I'd then need to do for all SOQL clauses) and one to specify whether commas delimiting SELECT items should be before or after each item, i.e.:

    SELECT Id, 
        Name, 
        LastModifiedDate
    FROM Account
    

    or:

    SELECT Id
        ,Name
        ,LastModifiedDate
    FROM Account
    

    I think what I've submitted address the main requirement, though, so I'll address those other items in a later work item.

  2. Aliaksandr Luferau

    Hello Scott. Also will be good a option to automatically wrap a list of fields in SOQL to multiple lines if it will be longest that right margin. As for example for JS array initializer "wrap if long" - see attached pic: wrap_if_long.png

  3. Log in to comment