tek / splain

better implicit errors for scala
MIT License
370 stars 29 forks source link

Support a global sbt setting. #3

Closed sellout closed 7 years ago

sellout commented 7 years ago

Ok, supporting anything but the latest compiler is not usually something I would suggest, but currently to enable splain globally, I have to put the following in my ~/.sbt/0.13/global.sbt:

libraryDependencies ++= (scalaBinaryVersion.value match {
  case "2.11" | "2.12" => Seq(compilerPlugin("tryp" %% "splain" % "0.1.11"))
  case _               => Nil
})

This is because global settings get picked up by everything including sbt itself, which uses Scala 2.10. So, without a 2.10 release of splain, I need to conditionalize loading it.

This isn’t a terrible workaround, but it’d be nice to be able to just drop addCompilerPlugin("tryp" %% "splain" % "0.1.11") into the global config and have it work. Also, if Splain is just integrated into an upcoming 2.12 release, then I don’t care about it working on 2.10 at all.

tek commented 7 years ago

right. 2.10 needs some special consideration, I'll get around to it.

tek commented 7 years ago

I hacked an implementation of the implicit messages for 2.10, but there are some breakages in other parts of the plugin, so for now it'll just be an empty plugin for 2.10, but at least it can be included with addCompilerPlugin.

sellout commented 7 years ago

Great, thanks. This works for me 😃