From 4c3e766ee17afdb44ceeeb764adc660e2a501e9f Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Wed, 11 Nov 2015 19:51:43 -0500 Subject: it's Scaladoc, not "ScalaDoc" or "Scala doc" renaming the existing ScalaDoc and ScalaDocReporter classes might break stuff, sadly, but at least we can fix the rest --- src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala | 4 ++-- src/scaladoc/scala/tools/nsc/doc/Settings.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/scaladoc') 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..90efa4e595 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -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.", "" ) -- cgit v1.2.3 From d9068b3358e8549ba7c36e083b39fa47bdfd4a6c Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Tue, 17 Nov 2015 23:20:10 +0000 Subject: Remove notes about -doc-title and -doc-version not being used Confirmed these options are used by editing build-ant-macros.xml and viewing the output, 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", -- cgit v1.2.3 From 6fceb3952b0f58095e1ac8727d9f368adc1fcae1 Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Wed, 18 Nov 2015 11:44:02 +0000 Subject: Add two missed scaladoc commands into scaladoc specific help section Prior to this change these scaladoc options were buried in the scalac section of the help text, -doc-external-doc -implicits-sound-shadowing With this change the options are listed in the scaladoc section. This will make the commands easier to discover. --- src/scaladoc/scala/tools/nsc/doc/Settings.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/scaladoc') diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index 90efa4e595..86ceea0b7d 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -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 -- cgit v1.2.3 From f0f7dcdb124d212d82ae7e0ea32f88175f6a664f Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Fri, 20 Nov 2015 22:33:43 +0000 Subject: Refactor excluded qname test to be more data like This refactoring extracts data from code into a form which is closer to configuration data. This is a step change toward making this configurable. --- src/scaladoc/scala/tools/nsc/doc/Settings.scala | 34 +++++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/scaladoc') diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index 90efa4e595..0dd308eb8c 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -275,24 +275,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 */ -- cgit v1.2.3 From 35dd1a9a07aa5e993212cef5fd401f5534a4725a Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Mon, 23 Nov 2015 20:34:24 +0000 Subject: Align DotRunner dot restart count with command option description This is the command option description, val docDiagramsDotRestart = IntSetting( "-diagrams-dot-restart", "The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)", 5, None, _ => None ) Prior to this change dot was restarted four times instead of five. Maybe the intention of the option was to allow a total number of attempts to be specified but with 5 restarts we need 6 attempts. The local var was renamed to reflect this. --- .../scala/tools/nsc/doc/html/page/diagram/DotRunner.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/scaladoc') 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") -- cgit v1.2.3