Closed bdrelling closed 6 years ago
Hi, according to the doc https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html I think in this moment you can use either:
enum Foo {
case one,
case two,
case three
}
or
enum Foo {
case one, two, three
}
And for swimat part. I don't know if this is a good format rule practice, but apple seems format this way even in switch.
enum Foo {
case
one,
two,
three
}
switch foo {
case
.one,
.two,
.three:
}
One reasonable way to correct it is
enum Foo {
case
one,
two,
three
}
Do you think this is better or not?
I think my expectation is that all of these work:
Note that the first one doesn't have trailing commas because case
is declared at the start of each line.
enum Foo {
case one
case two
case three
}
enum Foo {
case one, two, three
}
enum Foo {
case
one,
two,
three
}
Does this help?
Thanks
Build 1.5.3 will release recently, you can try here first or wait for other install method like brew cask. https://github.com/Jintin/Swimat/releases/tag/v1.5.3
Sorry for the ambiguous title, not exactly sure how to reference it.
In trying to auto format this:
It chooses to do this: