summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2015-11-23 17:21:18 +0100
committerLukas Rytz <lukas.rytz@typesafe.com>2015-11-23 17:21:18 +0100
commite5a748c56cfa387299cf665cd8c35635460a0ca7 (patch)
treeef3630aa28d291c2737cdc6004d8df542c7ad197 /src
parentd549eefe005149c639a5dff1bcf32194fe51927d (diff)
parentf0f7dcdb124d212d82ae7e0ea32f88175f6a664f (diff)
downloadscala-e5a748c56cfa387299cf665cd8c35635460a0ca7.tar.gz
scala-e5a748c56cfa387299cf665cd8c35635460a0ca7.tar.bz2
scala-e5a748c56cfa387299cf665cd8c35635460a0ca7.zip
Merge pull request #4856 from janekdb/2.11.x-scaladoc-excluded-classnames-more-data-like
Refactor excluded qname test to be more data like
Diffstat (limited to 'src')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/Settings.scala34
1 files changed, 23 insertions, 11 deletions
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 */