swiftlang / swiftlang/swift-syntax

`BasicFormat` cannot indent closure body in tuple

Open
#2,084 1 comment 0 reactions 0 assignees View on GitHub
BasicFormat
Dominant language
Swift
Stars
3.7k
Forks
553
Avg merge
5d 13h
Merged PRs (30d)
16

Description

### Description

`BasicFormat` cannot indent the closure body when it's nested in a `LabeledExprSyntax`.

### Steps to Reproduce

```swift
let builder = ExprSyntax(
"""
.init(
name: {
if let name {
return name
} else {
return "John"
}
}()
)
"""
)
assertBuildResult(
builder,
"""
.init(
name: {
if let name {
return name
} else {
return "John"
}
}()
)
"""
)
```

outputs:
```
Actual output (+) differed from expected output (-):
.init(
name: {
– if let name {
– return name
– } else {
– return "John"
– }
+ if let name {
+ return name
+ } else {
+ return "John"
+ }
}()
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.