Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected wrapping after where clause in multi-line SOQL queries #762

Open
no-stack-dub-sack opened this issue Jan 23, 2023 · 0 comments
Open

Comments

@no-stack-dub-sack
Copy link
Contributor

no-stack-dub-sack commented Jan 23, 2023

Hey @dangmai, is this behavior expected? Given that the line is less than my printWidth, I would expect Field2__c != 'Foo' to be formatted on the same line as the WHERE keyword, however it gets wrapped to the next line. Thoughts? Thanks :-)

# Prettier options (if any):
printWidth: 100

Input:

    List<Foo__c> fooList = [
      SELECT
        Id,
        Field1__c,
        Field2__c,
        LookupOne__c,
        LookupTwo__c,
        LookupThree__r.Name,
        Field6__c,
        Field7__c
      FROM Foo__c
      WHERE Field2__c != 'Foo'
        AND Field8__c != :someValue
        AND LookupThree__r.SomeStatus__c != 'Bar'
        AND (LookupTwo__c IN :someIdSet
        OR LookupOne__c IN :someOtherIdSet)
    ];

Actual output:

    List<Foo__c> fooList = [
      SELECT
        Id,
        Field1__c,
        Field2__c,
        LookupOne__c,
        LookupTwo__c,
        LookupThree__r.Name,
        Field6__c,
        Field7__c
      FROM Foo__c
      WHERE
        Field2__c != 'Foo'
        AND Field8__c != :someValue
        AND LookupThree__r.SomeStatus__c != 'Bar'
        AND (LookupTwo__c IN :someIdSet
        OR LookupOne__c IN :someOtherIdSet)
    ];

Expected output:
Same as input

Additional information:

  • OS: Windows 10
  • Version: 1.12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant