Formatting problem with creating objects inside function calls

Issue #2024 resolved
Aidan Harding created an issue

The indentation doesn’t seem right when you create a new object inside a function call, and then call methods on that object. e.g. if you are calling a chain of builder methods, and one of those takes a new object instance.

new al.SoqlBuilder()
    .selectx(new al.SoqlBuilder()
    .selectAll()
    .fromx(ShoppingList__c.Items__r.getDescribe().getName()))
    .fromx(ShoppingList__c.SObjectType.getDescribe().getName())
    .toSoql();

Should be formatted as:

new al.SoqlBuilder()
    .selectx(new al.SoqlBuilder()
        .selectAll()
        .fromx(ShoppingList__c.Items__r.getDescribe().getName()))
    .fromx(ShoppingList__c.SObjectType.getDescribe().getName())
    .toSoql();

Comments (2)

  1. Log in to comment