Skip to content

Line Breaks off of Static Queries in a SObject Constructor #319

@kacrouse

Description

@kacrouse
# Prettier options (if any):
none

Input:

Contact newContact = new Contact(FirstName = 'test', LastName = 'contact', AccountId = [SELECT Id FROM Account LIMIT 1].Id);

Actual output:

Contact newContact = new Contact(
    FirstName = 'test',
    LastName = 'contact',
    AccountId = [SELECT Id FROM Account LIMIT 1]
    .Id
);

Expected output:

Contact newContact = new Contact(
    FirstName = 'test',
    LastName = 'contact',
    AccountId = [SELECT Id FROM Account LIMIT 1].Id
);

Even if the query was longer to where it needed to be split across multiple lines, I still think the .Id should not be on its own line.

Additional information (please fill this out):

  • OS: macOS 11.0.1
  • Version: 1.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions