diff options
Diffstat (limited to 'dottydoc/src/dotty/tools')
5 files changed, 7 insertions, 74 deletions
diff --git a/dottydoc/src/dotty/tools/dottydoc/DottyDoc.scala b/dottydoc/src/dotty/tools/dottydoc/DottyDoc.scala index bef9141f2..e19805d21 100644 --- a/dottydoc/src/dotty/tools/dottydoc/DottyDoc.scala +++ b/dottydoc/src/dotty/tools/dottydoc/DottyDoc.scala @@ -26,7 +26,7 @@ import _root_.java.util.{ Map => JMap } * 2. Create an AST that is serializable * 3. Serialize to JS object */ -class DottyDocCompiler extends Compiler { +class DocCompiler extends Compiler { override def phases: List[List[Phase]] = List( List(new DocFrontEnd), List(new DocImplicitsPhase), @@ -36,11 +36,6 @@ class DottyDocCompiler extends Compiler { new LinkImplicitlyAddedTypes, new SortMembers)) ) - - override def newRun(implicit ctx: Context): Run = { - reset() - new DocRun(this)(rootContext) - } } class DocFrontEnd extends FrontEnd { @@ -48,26 +43,7 @@ class DocFrontEnd extends FrontEnd { unit.isJava } -class DocRun(comp: Compiler)(implicit ctx: Context) extends Run(comp)(ctx) { - def fromDirectory(f: String): List[String] = { - val file = new PlainFile(f) - - if (!file.isDirectory && f.endsWith(".scala")) List(f) - else if (!file.isDirectory) Nil - else file.iterator.flatMap { - case x if x.isDirectory => fromDirectory(x.canonicalPath) - case x => List(x.canonicalPath) - }.toList - } - - /** If DocRecursive is set, then try to find all scala files! */ - override def compile(fileNames: List[String]): Unit = super.compile( - if (ctx.settings.DocRecursive.value) fileNames flatMap fromDirectory - else fileNames - ) -} - -abstract class DottyDocDriver extends Driver { +abstract class DocDriver extends Driver { import scala.collection.JavaConverters._ override def setup(args: Array[String], rootCtx: Context): (List[String], Context) = { @@ -81,7 +57,7 @@ abstract class DottyDocDriver extends Driver { (fileNames, ctx) } - override def newCompiler(implicit ctx: Context): Compiler = new DottyDocCompiler + override def newCompiler(implicit ctx: Context): Compiler = new DocCompiler def compiledDocs(args: Array[String]): collection.Map[String, Package] = { diff --git a/dottydoc/src/dotty/tools/dottydoc/api/java/Dottydoc.java b/dottydoc/src/dotty/tools/dottydoc/api/java/Dottydoc.java index c50688c77..b461c3096 100644 --- a/dottydoc/src/dotty/tools/dottydoc/api/java/Dottydoc.java +++ b/dottydoc/src/dotty/tools/dottydoc/api/java/Dottydoc.java @@ -1,13 +1,13 @@ package dotty.tools.dottydoc.api.java; -import dotty.tools.dottydoc.DottyDocDriver; +import dotty.tools.dottydoc.DocDriver; import dotty.tools.dottydoc.model.Package; import dotty.tools.dottydoc.util.OutputWriter; import java.util.Map; import java.util.List; /** FIXME: document me! */ -public class Dottydoc extends DottyDocDriver { +public class Dottydoc extends DocDriver { public Map<String, Package> createIndex(String[] args) { return compiledDocsJava(args); } diff --git a/dottydoc/src/dotty/tools/dottydoc/api/scala/Dottydoc.scala b/dottydoc/src/dotty/tools/dottydoc/api/scala/Dottydoc.scala index 373fae39a..dce994f5d 100644 --- a/dottydoc/src/dotty/tools/dottydoc/api/scala/Dottydoc.scala +++ b/dottydoc/src/dotty/tools/dottydoc/api/scala/Dottydoc.scala @@ -1,13 +1,13 @@ package dotty.tools.dottydoc.api.scala -import dotty.tools.dottydoc.DottyDocDriver +import dotty.tools.dottydoc.DocDriver import dotty.tools.dottydoc.model.Package import dotty.tools.dottydoc.util.OutputWriter import scala.collection.Map /** FIXME: document this class plz */ -trait Dottydoc extends DottyDocDriver { +trait Dottydoc extends DocDriver { def createIndex(args: Array[String]): Map[String, Package] = compiledDocs(args) diff --git a/dottydoc/src/dotty/tools/dottydoc/core/OutputJsonPhase.scala b/dottydoc/src/dotty/tools/dottydoc/core/OutputJsonPhase.scala deleted file mode 100644 index 9f8dfdca6..000000000 --- a/dottydoc/src/dotty/tools/dottydoc/core/OutputJsonPhase.scala +++ /dev/null @@ -1,13 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.CompilationUnit -import dotc.core.Contexts.Context -import dotc.core.Phases.Phase -import model.{Package, Entity} - -abstract class JsonOutputPhase extends Phase { - def phaseName = "jsonOutputPhase" - println("wabalubadubdub") -} diff --git a/dottydoc/src/dotty/tools/dottydoc/core/PrintPhase.scala b/dottydoc/src/dotty/tools/dottydoc/core/PrintPhase.scala deleted file mode 100644 index 080687877..000000000 --- a/dottydoc/src/dotty/tools/dottydoc/core/PrintPhase.scala +++ /dev/null @@ -1,30 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.CompilationUnit -import dotc.core.Contexts.Context -import dotc.core.Phases.Phase -import model.{Package, Entity} - -/** TODO: re-write to `DocMiniPhase` */ -//class PrintPhase extends Phase { -// def phaseName = "docPrintPhase" -// -// var currentRun = 0 -// override def run(implicit ctx: Context): Unit = () -// -// override def runOn(units: List[CompilationUnit])(implicit ctx: Context): List[CompilationUnit] = { -// val compUnits = super.runOn(units) -// val packages = ctx.docbase.packages[Package].toMap -// -// val outputDir = { -// val out = ctx.settings.DocOutput.value -// if (out.last == '/') out.dropRight(1) -// else out -// } -// if (!ctx.settings.YDocNoWrite.value) (new util.OutputWriter).write(packages, outputDir) -// -// compUnits -// } -//} |