aheze/Multiliner

Suggestion: add option for first parameter to be on same line

orchetect opened this issue ยท 6 comments

While I am actually a fan of Multiliner's current formatting behavior, some people might prefer not having a line-break between the method name and the first parameter.

Current Behavior

func sendAppStatus(
    to toNodes: [Node],
    name: String?,
    bundleID: String,
    state: Int32,
    isDockApp: Bool
) {
    // ...
}

Proposed opt-in behavior (as a preference)

First parameter starts on the same line, and closing parens trails immediately after the last parameter.

func sendAppStatus(to toNodes: [Node],
                   name: String?,
                   bundleID: String,
                   state: Int32,
                   isDockApp: Bool) {
    // ...
}
aheze commented

EWWWWWWWWWWWWWWWW

aheze commented

But sure, I'll add a preference. Need to figure out how to share data between the main app and the extension though...

I hate it too, just looking out for others ๐Ÿ˜Ž

I can foresee some other options being added in future so wouldn't be a bad idea to figure it out. And another reason why unit tests will become increasingly useful if more options get added.

Just wanted to create the same suggestion but it already exists. Only one clarification - not only the first parameter shouldn't be on a separate line, but also the closing round bracket.

With the current implementation we will get this formatting:

ClickableCard(
    image: "",
    title: "",
    value: "",
    action: { }
)

My proposition to have an option for this:

ClickableCard(image: "",
              title: "",
              value: "",
              action: { })

My proposition to have an option for this:

ClickableCard(image: "",
              title: "",
              value: "",
              action: { })

That's what my example already shows but I can amend the request wording to be explicit.