Swimat
Swimat copied to clipboard
Weird indentation with type inference on methods
What is the issue
Swimat's indentation seems to behave incorrectly with lines beginning with . which are inferring a type.
For example:
func myFunction() -> MyClass {
.init(
myParam: someValue
)
}
If it were MyClass above instead of .init the indentation works as expected, but it's nicer to use type inference.
Even a single line indents too much:
func myFunction() -> UIView {
.init(frame: .zero)
}
Expected behavior
func myFunction() -> MyClass {
.init(
myParam: someValue
)
}
Desktop (please complete the following information):
- OS: macOS 11.0.1 (20B50)
- App Version 1.70
Additional context Does this in the Preview tool of the Swimat macOS app too.
I'm getting the same thing with single lines being indented too much:
init() {
UINavigationBar.appearance().largeTitleTextAttributes = [
.foregroundColor: UIColor.white // This line is indented twice
]
}
Thanks for the awesome tool @Swimat team, can't wait for more improvements