Skip to content

alignParameters can exploit natural anchors in method/class definitions #61

@paulp

Description

@paulp

Here's an example of the work of alignParameters on the scala library:

def showInput[A](parent: Component = null,
                 message: Any,
                 title: String = uiString("OptionPane.inputDialogTitle"),
                 messageType: Message.Value = Message.Question,
                 icon: Icon = EmptyIcon,
                 entries: Seq[A] = Nil,
                 initial: A): Option[A] = {

Here is what I think that ought to look like. Rather than putting all parameters flush at the left margin, it anchors on : (left and right) and =.

This gives us three columns each with a uniform margin (names, types, and default values) rather than one.

def showInput[A](parent: Component     = null,
                message: Any,
                  title: String        = uiString("OptionPane.inputDialogTitle"),
            messageType: Message.Value = Message.Question,
                   icon: Icon          = EmptyIcon,
                entries: Seq[A]        = Nil,
                initial: A
): Option[A] = {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions