diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-11-24 10:17:40 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-11-24 10:17:40 +0100 |
commit | 86300fe1b3ab87b2e40616ed78709e8f03e707b5 (patch) | |
tree | 4458169015b02ecf7e29f805d0dbd6645171620a /src/scaladoc | |
parent | 3d0cbf9d10416fab8017b5fb46af44f59ee89fd1 (diff) | |
parent | 8eb1d4c29d85aef7828eeb35169e80c085cea93e (diff) | |
download | scala-86300fe1b3ab87b2e40616ed78709e8f03e707b5.tar.gz scala-86300fe1b3ab87b2e40616ed78709e8f03e707b5.tar.bz2 scala-86300fe1b3ab87b2e40616ed78709e8f03e707b5.zip |
Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24
Diffstat (limited to 'src/scaladoc')
3 files changed, 35 insertions, 22 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala index cbf8ff22ba..8ea8c4deff 100644 --- a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala +++ b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala @@ -125,9 +125,9 @@ abstract class ScaladocSyntaxAnalyzer[G <: Global](val global: G) extends Syntax } else if (in.ch == '*') { docBuffer = null in.next - val scalaDoc = ("/**", "*/") + val scaladoc = ("/**", "*/") if (in.ch == '*') - docBuffer = new StringBuilder(scalaDoc._1) + docBuffer = new StringBuilder(scaladoc._1) do { do { if (in.ch != '*' && in.ch != SU) { diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index 067b2b2c29..a63ed1abe8 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -25,7 +25,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) ) /** A setting that defines the overall title of the documentation, typically the name of the library being - * documented. ''Note:'' This setting is currently not used. */ + * documented. */ val doctitle = StringSetting ( "-doc-title", "title", @@ -34,7 +34,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) ) /** A setting that defines the overall version number of the documentation, typically the version of the library being - * documented. ''Note:'' This setting is currently not used. */ + * documented. */ val docversion = StringSetting ( "-doc-version", "version", @@ -45,7 +45,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) val docfooter = StringSetting ( "-doc-footer", "footer", - "A footer on every ScalaDoc page, by default the EPFL/Typesafe copyright notice. Can be overridden with a custom footer.", + "A footer on every Scaladoc page, by default the EPFL/Typesafe copyright notice. Can be overridden with a custom footer.", "" ) @@ -212,9 +212,10 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) // For improved help output. def scaladocSpecific = Set[Settings#Setting]( docformat, doctitle, docfooter, docversion, docUncompilable, docsourceurl, docgenerator, docRootContent, useStupidTypes, + docExternalDoc, docAuthor, docDiagrams, docDiagramsDebug, docDiagramsDotPath, docDiagramsDotTimeout, docDiagramsDotRestart, - docImplicits, docImplicitsDebug, docImplicitsShowAll, docImplicitsHide, + docImplicits, docImplicitsDebug, docImplicitsShowAll, docImplicitsHide, docImplicitsSoundShadowing, docDiagramsMaxNormalClasses, docDiagramsMaxImplicitClasses, docNoPrefixes, docNoLinkWarnings, docRawOutput, docSkipPackages, docExpandAllTypes, docGroups @@ -275,24 +276,36 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) ("scala.reflect.ClassManifest" -> ((tparam: String) => tparam + " is accompanied by a ClassManifest, which is a runtime representation of its type that survives erasure")) + ("scala.reflect.OptManifest" -> ((tparam: String) => tparam + " is accompanied by an OptManifest, which can be either a runtime representation of its type or the NoManifest, which means the runtime type is not available")) + ("scala.reflect.ClassTag" -> ((tparam: String) => tparam + " is accompanied by a ClassTag, which is a runtime representation of its type that survives erasure")) + - ("scala.reflect.api.TypeTags.WeakTypeTag" -> ((tparam: String) => tparam + " is accompanied by an WeakTypeTag, which is a runtime representation of its type that survives erasure")) + + ("scala.reflect.api.TypeTags.WeakTypeTag" -> ((tparam: String) => tparam + " is accompanied by a WeakTypeTag, which is a runtime representation of its type that survives erasure")) + ("scala.reflect.api.TypeTags.TypeTag" -> ((tparam: String) => tparam + " is accompanied by a TypeTag, which is a runtime representation of its type that survives erasure")) + private val excludedClassnamePatterns = Set( + """^scala.Tuple.*""", + """^scala.Product.*""", + """^scala.Function.*""", + """^scala.runtime.AbstractFunction.*""" + ) map (_.r) + + private val notExcludedClasses = Set( + "scala.Tuple1", + "scala.Tuple2", + "scala.Product", + "scala.Product1", + "scala.Product2", + "scala.Function", + "scala.Function1", + "scala.Function2", + "scala.runtime.AbstractFunction0", + "scala.runtime.AbstractFunction1", + "scala.runtime.AbstractFunction2" + ) + /** * Set of classes to exclude from index and diagrams * TODO: Should be configurable */ def isExcluded(qname: String) = { - ( ( qname.startsWith("scala.Tuple") || qname.startsWith("scala.Product") || - qname.startsWith("scala.Function") || qname.startsWith("scala.runtime.AbstractFunction") - ) && !( - qname == "scala.Tuple1" || qname == "scala.Tuple2" || - qname == "scala.Product" || qname == "scala.Product1" || qname == "scala.Product2" || - qname == "scala.Function" || qname == "scala.Function1" || qname == "scala.Function2" || - qname == "scala.runtime.AbstractFunction0" || qname == "scala.runtime.AbstractFunction1" || - qname == "scala.runtime.AbstractFunction2" - ) - ) + excludedClassnamePatterns.exists(_.findFirstMatchIn(qname).isDefined) && !notExcludedClasses(qname) } /** Common conversion targets that affect any class in Scala */ diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala index 9381cf3a35..9287bfbc2b 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala @@ -18,16 +18,16 @@ import model._ /** This class takes care of running the graphviz dot utility */ class DotRunner(settings: doc.Settings) { - private[this] var dotRestarts = 0 + private[this] var dotAttempts = 0 private[this] var dotProcess: DotProcess = null def feedToDot(dotInput: String, template: DocTemplateEntity): String = { if (dotProcess == null) { - if (dotRestarts < settings.docDiagramsDotRestart.value) { - if (dotRestarts != 0) + if (dotAttempts < settings.docDiagramsDotRestart.value + 1) { + if (dotAttempts > 0) settings.printMsg("Graphviz will be restarted...\n") - dotRestarts += 1 + dotAttempts += 1 dotProcess = new DotProcess(settings) } else return null @@ -41,7 +41,7 @@ class DotRunner(settings: doc.Settings) { if (result == null) { dotProcess.cleanup() dotProcess = null - if (dotRestarts == settings.docDiagramsDotRestart.value) { + if (dotAttempts == 1 + settings.docDiagramsDotRestart.value) { settings.printMsg("\n") settings.printMsg("**********************************************************************") settings.printMsg("Diagrams will be disabled for this run because the graphviz dot tool") |