Skip to content

Conversation

daniel-trinh
Copy link
Collaborator

  • Parameters now not only align by the first token in a parameter,
    but also by the type and any defaults in the parameter

    Original Source, before running scalariform

      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]

    Before this update, after running scalariform

      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]

    After this update, after running scalariform

      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]
  • The implicit modifier is now placed on it's own line in parameters if AlignParameters is enabled (and there's a newline in the parameter)

    Original Source, before running scalariform

      def(
        arg1: String
      )(
        implicit arg2: ExecutionContext = Akka.system,
        arg3: SomeImplicitableType
      )

    Before this update, after running scalariform

      def(
        arg1: String)(
          implicit arg2: ExecutionContext = Akka.system,
          arg3: SomeImplicitableType)

    After this update, after running scalariform

      def(
        arg1: String)(
          implicit
          arg2: ExecutionContext     = Akka.system,
          arg3: SomeImplicitableType)
  • Multi-line types will not be placed on a new line unless the original source
    parameter started with a newline

    Original Source, before running scalariform

      class A(a: Int,
      b: Int)(c: { val d: Int
      })

    Before this update, after running scalariform

      class A(a: Int,
              b: Int)(
                c: {
                  val d: Int
                })

    After this update, after running scalariform

      class A(a: Int,
              b: Int)(c: {
                        val d: Int
                      })

@buildhive
Copy link

Matt Russell » scalariform #40 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Matt Russell » scalariform #41 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Matt Russell » scalariform #42 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Matt Russell » scalariform #43 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Matt Russell » scalariform #44 SUCCESS
This pull request looks good
(what's this?)

@buildhive
Copy link

Matt Russell » scalariform #45 SUCCESS
This pull request looks good
(what's this?)

@paulp
Copy link

paulp commented Jan 22, 2014

@daniel-trinh This repository went dark around the time I opened #61. (See the pull request I opened for #62 a full year ago, never touched.) I think you should consider it abandoned.

@daniel-trinh
Copy link
Collaborator Author

@paulp Yea, I ran into @mdr a few days ago on reddit, he pretty much confirmed it was abandoned (although with intentions to revive it this year).

I'll be publishing a SNAPSHOT versioned fork with this soon, followed by #53, #61, #62, #47, and #69 -- I've been waiting for this scalariform feature ever since I saw this issue and noticed golang's gofmt was doing something similar.

@daniel-trinh
Copy link
Collaborator Author

Here's the snapshot:

Resolver:

resolvers += "Sonatype OSS Snapshots" 
  at "https://oss.sonatype.org/content/repositories/snapshots"

sbt plugin usage:

addSbtPlugin("com.danieltrinh" % "sbt-scalariform" % "1.3.0-SNAPSHOT")

See here for configuring build.sbt and Build.scala,
and here for details on the new formatting options.

sbt sbt > scalariformFormat usage:

libraryDependencies += "com.danieltrinh" %% "scalariform" % "1.5.0-SNAPSHOT"

@dragos
Copy link
Member

dragos commented May 24, 2014

@daniel-trinh, would you be interested in maintaining your fork going forward? We could bundle this in the Eclipse Scala IDE.

@daniel-trinh
Copy link
Collaborator Author

@dragos, sure thing -- LMK what's needed on my end to get things moving. For now, I've published Scalariform for Scala 2.9, 2.10, and 2.11 to Sonatype releases: daniel-trinh#18

@dragos
Copy link
Member

dragos commented May 28, 2014

@daniel-trinh, that's a great start. We have a special setup:

  • maven builds (we build the IDE every night on top of Scala nightly builds). Scalariform needs to keep pom files around
  • expose the new preferences in Eclipse (contributions really welcome)
  • versioned releases (for build reproducibility, and to make sure we ship the same thing as the sbt plugin) -- I really liked the changelog for your 0.1.5 release.

We'll have to see if we simply build from your fork, or update our mirror (we might need additional tags, but maybe we can do with just the release ones).

@kiritsuku kiritsuku merged commit 50da347 into scala-ide:master Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants