swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.51k stars 10.35k forks source link

[SR-9984] [SourceKit] Wrong indentation with chained call after closure #52388

Open marcelofabri opened 5 years ago

marcelofabri commented 5 years ago
Previous ID SR-9984
Radar None
Original Reporter @marcelofabri
Type Bug
Environment Swift 5.0
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Source Tooling | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: e8b11c0dd9249e2f08f1c75e96104c02

Issue Description:

Xcode/SourceKit formats like this:

let bar = ["baz","blee"].map {
    $0
    }.count

let bar = ["baz","blee"].map {
    $0
    }.filter {
        $0.count > 3
}

It should be like this:

let bar = ["baz","blee"].map {
    $0
}.count

let bar = ["baz","blee"].map {
    $0
}.filter {
    $0.count > 3
}

Possibly related to SR-9983.

belkadan commented 5 years ago

@benlangmuir, who works on indentation support?

benlangmuir commented 5 years ago

CC @nkcsgexi