sbt / sbt-boilerplate

sbt plugin for generating scala.Tuple/Function related boilerplate code
BSD 2-Clause "Simplified" License
109 stars 19 forks source link

Sharp escaping or using a character other than sharp #12

Closed alexarchambault closed 8 years ago

alexarchambault commented 10 years ago

When generating a template with type-lambdas (like in ({ type Out[A] = ... })#Out), one runs into errors because of the sharp character in the type-lambda.

There seems to be no way of escaping it. As a quick fix for a unpublished yet project of mine, I made some changes in sbt-boilerplate so that users can use another character instead of #, by adding to their build.sbt a line of the form:

Boilerplate.boilerplateSpecialToken in Boilerplate.boilerplateGenerate := "$"

to use $ instead of # for example. These changes are in my fork (https://github.com/alexarchambault/sbt-boilerplate) for now.

So my question is: do you intend to allow escaping of the sharp character at some point? Or could my fix be of any interest to you?

alexarchambault commented 9 years ago

... ping?

jrudolph commented 9 years ago

@alexarchambault yes, I agree, that this is a somewhat embarrassing oversight which should be fixed. I'll guess I will rather add escaping syntax than allowing to customize syntax further because it would be the smaller fix.

ryan-richt commented 9 years ago

Same issue with using Scala's type projections (T#X). Would love to see this merged into a new published version!

marklister commented 9 years ago

@ryan-richt, one workaround is to package a source dependency on a fork: see https://github.com/marklister/product-collections/blob/master/project/project/build.scala

The hashcode makes the dependency stable.

jrudolph commented 8 years ago

I finally merged @marklister's fix and will soon make a release. Sorry for the hold-up.