Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-7846] [SourceKit] bracket indentation is incorrect for literals with trailing comma #50382

Closed
swift-ci opened this issue Jun 1, 2018 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 1, 2018

Previous ID SR-7846
Radar None
Original Reporter j-h-a (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee @keith
Priority Medium

md5: 035fb769d2eb81825401ee97cfdcf69c

Issue Description:

When formatting array/dictionary literals that have a trailing comma after their final element, SourceKit indents closing brackets to the same level as the elements instead of the opening line.

Steps to reproduce:

Minimal example.swift file:

struct TheStruct {
    let anArray = [
        1,
        2,
    ]
}

Run: sourcekitten format --file example.swift

Expected behaviour: The above format is already correct, contents should be unchanged.
Actual behaviour: The closing "]" is indented to the same level as the "2,".

@keith
Copy link
Collaborator

keith commented Jul 25, 2018

Submitted a potential fix for this here #18231

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants