Bintray with sbt "addCompilerPlugin"

Hi,

Well, I might still need to deal with break statements which probably means making my own control flow graph (unless there is a way of accessing one that scalac generates?). I hadn’t realised I really needed that before publishing…

Yes! I have made a list of things which would be useful to have, in my opinion:

It would have really helped to get a link to the quasiquotes page: https://docs.scala-lang.org/overviews/quasiquotes/syntax-summary.html
with an explanation that these are useful for pattern matching, and an example.

This doesn’t seem to be true anymore:
“”"
Note however that addCompilerPlugin only adds the JAR to the compilation classpath;
it doesn’t actually enable the plugin.
To do that, you must customize scalacOptions to include the appropriate -Xplugin call.
To shield users from having to know this,
it’s relatively common for compiler plugin authors to also write an accompanying sbt plugin
that takes of customizing the classpath and compiler options appropriately.
Then using your plugin only requires adding an addSbtPlugin(…) call to project/plugins.sbt.
“”"
so removing that would be good.
Same for:
“”"
To use the plugin, a user adds the JAR file to their compile-time classpath and enables it by invoking scalac with -Xplugin:…
“”"

Also, this is I guess more of a problem with Intellij, but it kept highlighting my correct plugin code in red which was very confusing.
It would be nice if the page warned that some editors do this and that one should try compiling it anyway.
For me it was mostly having problems with Trees#Tree, List[List[ValDef]] and Seq[Trees#Tree], and I ended up just supressing the red highlighting.

It would have been helpful to get more of an explanation of how the internals of the division by zero example plugin worked.
By the internals, I mean this part:

for ( tree @ Apply(Select(rcvr, nme.DIV), List(Literal(Constant(0)))) <- unit.body
             if rcvr.tpe <:< definitions.IntClass.tpe)
          {
            global.reporter.error(tree.pos, "definitely division by zero")
          }

Explaining that it looks through the (abstract synthax tree of) code for methods and for each one checks if it is division by zero.
(Adding the link to the quasiquotes page here might be good as they are a different way to pattern match)

Also, it wasn’t clear to me that the xml file actually
needs to be in the “src\main\scala” directory for the publishing to work, so mentioning that would be good.
(I originally thought that the xml file was only needed for creating the jar locally and that the publishing would take that jar instead of what was inside my src folder, which admittedly was very foolish of me)

It would be great if
“”"
When you are happy with how the plugin behaves, you may wish to publish the JAR to a Maven or Ivy repository where it can be resolved by a build tool.
“”"
had more information on how to publish a project, or linked to some tutorials.
Knowing how addCompilerPlugin() worked (what arguments it takes) would have been very useful.

Also the talk you did was quite helpful for me as an introduction to compiler plugins, so it would be nice to have on the page, if that’s possible:

Thanks for your help!