I have a wrong formated code func foo(a: Int, b: Int, c: Int) { ... }
And when I use --wraparguments, it doesn't work. Wraparguments works only when it's is partially formatted:
then beforefirst afterfirst works.
Is it possible to force format of top function, to afterfirst, when arguments are in one line?
@michalcickan it’s not possible currently. wraparguments will only rewrap functions that have already been wrapped onto multiple lines. I’ll consider adding an option for this.
May or may not be the same, but I've had to disable _wrapArguments_ because formatting was going from this
MultivaluedSection(multivaluedOptions: [.Insert, .Delete]
// ,
// header: "Multivalued TextField",
// footer: ".Insert adds a 'Add Item' (Add New Tag) button row as last cell."
){
$0.addButtonProvider = { section in
to this
MultivaluedSection(multivaluedOptions: [.Insert, .Delete]
// ,
//) { header: "Multivalued TextField",
$0.addButtonProvider = { section in
both with _after-first_ & _preserve_, i.e. a comment line was misplaced, a second was gone, and closing parenthesis / opening bracket was commented out, that of course triggered a syntax error.
Easy fix on our side, still wanted to point this out…
@pmanna thanka for reporting. This isn't really the same issue, but it looks like a serious bug and I'll get it fixed asap.
@pmanna the bug you reported is fixed in version 0.40.0.
@nicklockwood Thanks, great support!
@michalcickan swiftformat 0.41.0 now allows you to specify a --maxwidth option and will wrap arguments that exceed it automatically.
Most helpful comment
@michalcickan it’s not possible currently.
wrapargumentswill only rewrap functions that have already been wrapped onto multiple lines. I’ll consider adding an option for this.