Pretty cool, right? Unfortunately, there haven’t been very many updates to the official version of this super awesome project lately,
so I decided to fork the project and start improving upon it myself. Since I use Scala quite often, I’ve got some pretty strong motivation to work on improving it.
Here’s a quick summary of what I’ve added to Scalariform so far:
// Parameter names, types, and defaults are aligned into three separate columnsdefshowInput[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]// Two newlines will result in separate alignment groups caseclassCake(icingFlavor:Flavor=Vanilla,cakeFlavor:Flavor=Chocolate,candles:Int=1,layers:Int=3,iceCream:Boolean=False)// Same feature working with method callso.manyArguments(abc=0,abcOne=1,abcTwo,abcThree=3,abcFour=4,abcFive=3)
And here’s how to use my version:
Scalariform Formatting with My Changes
1234
// Add this to .../project/plugins.sbtresolvers+="Sonatype OSS Snapshots"at"https://oss.sonatype.org/content/repositories/snapshots"addSbtPlugin("com.danieltrinh"%"sbt-scalariform"%"1.3.0-SNAPSHOT")
See the plugin for how to configure formatting options, and the Scalariform readme
for available formatting options.
Since this is an ongoing project, there will be more updates to come.