Splitting scalac plugin into multiple files?

Here's a really old project where I've done the same thing: https://github. Com/jsuereth/osgi-scalac-plugin/blob/master/src/main/scala/scala/osgi/compiler/OsgiPlugin. Scala If you don't need to pass path-dependent types from the global, don't worry about trying to keep the "this.

Global" portions of it relevant.

In the Scala Refactoring library, I solved it by having a trait CompilerAccess: trait CompilerAccess { val global: tools.nsc. Global } Now all the other traits that need to access global just declare CompilerAccess as a dependency: trait TreeTraverser { this: CompilerAccess => import global. _ ... } and then there's a class that mixes in all these traits and provides an instance of global: trait SomeRefactoring extends TreeTraverser with OtherTrait with MoreTraits { val global = //wherever you get your global from } This scheme worked quite well for me.

You can create a separate class for your component and pass global in: class TemplateComponent(val global: Global) extends PluginComponent { import global. _ val runsAfter = ListString("refchecks") val phaseName = "plugintemplate" def newPhase(prev: Phase) = new StdPhase(prev) { override def name = phaseName def apply(unit:CompilationUnit) = { } } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions