Jintin / Swimat

An Xcode formatter plug-in to format your swift code.
https://jintin.github.io/Swimat/
MIT License
1.65k stars 89 forks source link

Enum cases has wrong indent in `Array` #218

Open akuzminskyi opened 4 years ago

akuzminskyi commented 4 years ago

I'm using 2 spaces indention in Xcode and when I have array of enum cases Swimat format it with 4 spaces if I'm using a short form .one, but if I'm using a full form with the type(MyEnum.one) it uses again 2 spaces.

I think it always should be as 2 spaces(or based on Xcode preferences values).

enum MyEnum {
  case one
  case two
}

func test(array: [MyEnum]) { }

test(
  array: [
      .one,  // 4 spaces indent
      .two  // 4 spaces indent
  ]
)

test(
  array: [
    MyEnum.one, // 2 spaces indent
    MyEnum.two  // 2 spaces indent
  ]
)