swiftlang / swift

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

[SR-9983] [SourceKit] Wrong indentation when calling method/property on multi-line collection literal #52387

Open marcelofabri opened 5 years ago

marcelofabri commented 5 years ago
Previous ID SR-9983
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: 1424e76adf8b29739b03db0a186530c9

Issue Description:

Xcode/SourceKit formats like this:

let bar = [
    "baz",
    "blee",
    ].count

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

This is how it should be formatted:

let bar = [
    "baz",
    "blee"
].count

let bar = [
    "baz",
    "blee"
].map {
    $0
}
benlangmuir commented 5 years ago

CC @nkcsgexi