aheze/Multiliner

Closing parens of function returning a closure put onto wrong line

Opened this issue · 1 comments

Played around with Multiliner a bit :)

Given this input:

func applyContentActions(action: AppAction, reducers: [TableActionReducer]) -> (_ documentState: DocumentState) -> DocumentState {
    ...
}

I expected somewhat along these lines::

func applyContentActions(
    action: AppAction,
    reducers: [TableActionReducer]
) -> (_ documentState: DocumentState) -> DocumentState {
    ...
}

Actual output did try to put the parens and the arrow onto a new line, but not the first occurrence:

func applyContentActions(
    action: AppAction,
    reducers: [TableActionReducer]) -> (_ documentState: DocumentState
) -> DocumentState {
    ...
}
aheze commented

Yeah, the formatting script is kind of dumb right now, it just checks for the first and last occurrence of the parentheses and splits the content within that. Something smarter would help #3 too