Skip to content

Various ForInStmtSyntax builder regressions #1515

Closed
@stevapple

Description

@stevapple

Description

We've found a series of regressions when building ForInStmtSyntax, including:

  • awaitKeyword is defaulted to .keyword(.await) instead of nil, which is unexpected for most users;
  • BasicFormat fails to add spacing after awaitKeyword.

Steps to Reproduce

let buildable = ForInStmtSyntax(pattern: PatternSyntax("element"), sequenceExpr: ExprSyntax("array")) {
  ExprSyntax("print(element)")
}
print(buildable.formatted())

Outputs:

for awaitelement in array {
    print(element)
}

Expected:

for element in array {
    print(element)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions