Permalink
Browse files

Remove scaladoc deprecated option.

Remove -external-urls that had been previously deprecated in 2.10.
  • Loading branch information...
vigdorchik committed Apr 10, 2013
1 parent 53b0180 commit e1af9737d0e68a5a14e2837e14b91ad3bd93f0fb
@@ -199,12 +199,6 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
"Expand all type aliases and abstract types into full template pages. (locally this can be done with the @template annotation)"
)
- val docExternalUrls = MultiStringSetting (
- "-external-urls",
- "externalUrl(s)",
- "(deprecated) comma-separated list of package_names=doc_URL for external dependencies, where package names are ':'-separated"
- )
-
val docGroups = BooleanSetting (
"-groups",
"Group similar functions together (based on the @group annotation)"
@@ -254,15 +248,6 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
if (url.endsWith(index)) url else url + index
}
- // Deprecated together with 'docExternalUrls' option.
- lazy val extUrlPackageMapping: Map[String, String] = (Map.empty[String, String] /: docExternalUrls.value) {
- case (map, binding) =>
- val idx = binding indexOf "="
- val pkgs = binding substring (0, idx) split ":"
- val url = appendIndex(binding substring (idx + 1))
- map ++ (pkgs map (_ -> url))
- }
-
lazy val extUrlMapping: Map[String, String] = docExternalDoc.value flatMap { s =>
val idx = s.indexOf("#")
if (idx > 0) {
@@ -49,13 +49,6 @@ trait MemberLookup extends base.MemberLookupBase {
settings.extUrlMapping get path map { url =>
LinkToExternal(name, url + "#" + name)
}
- } orElse {
- // Deprecated option.
- settings.extUrlPackageMapping find {
- case (pkg, _) => name startsWith pkg
- } map {
- case (_, url) => LinkToExternal(name, url + "#" + name)
- }
}
}
@@ -1 +0,0 @@
-Done.
@@ -1,72 +0,0 @@
-import scala.tools.nsc.doc.model._
-import scala.tools.nsc.doc.base._
-import scala.tools.nsc.doc.base.comment._
-import scala.tools.partest.ScaladocModelTest
-import java.net.{URI, URL}
-import java.io.File
-
-object Test extends ScaladocModelTest {
-
- override def code =
- """
- /** See:
- * - [[scala.collection.Map]] Simple linking
- * - [[scala.collection.immutable.::]] Linking with symbolic name
- * - [[scala.Int]].toLong Linking to a class
- * - [[scala.Predef]] Linking to an object
- * - [[scala.Int.toLong]] Linking to a method
- * - [[scala]] Linking to a package
- * - [[scala.AbstractMethodError]] Linking to a member in the package object
- * - [[scala.Predef.String]] Linking to a member in an object
- *
- * Don't look at:
- * - [[scala.NoLink]] Not linking :)
- */
- object Test {
- def foo(param: Any) {}
- def barr(l: scala.collection.immutable.List[Any]) {}
- def bar(l: List[String]) {} // TODO: Should be able to link to type aliases
- def baz(d: java.util.Date) {} // Should not be resolved
- }
- """
-
- def scalaURL = "http://bog.us"
-
- override def scaladocSettings = "-no-link-warnings -external-urls scala=" + scalaURL
-
- def testModel(rootPackage: Package) {
- import access._
- val test = rootPackage._object("Test")
-
- def check(memberDef: Def, expected: Int) {
- val externals = memberDef.valueParams(0)(0).resultType.refEntity collect {
- case (_, (LinkToExternal(name, url), _)) => assert(url.contains(scalaURL)); name
- }
- assert(externals.size == expected)
- }
-
- check(test._method("foo"), 1)
- check(test._method("bar"), 0)
- check(test._method("barr"), 2)
- check(test._method("baz"), 0)
-
- val expectedUrls = collection.mutable.Set[String](
- "scala.collection.Map",
- "scala.collection.immutable.::",
- "scala.Int",
- "scala.Predef$",
- "scala.Int@toLong:Long",
- "scala.package",
- "scala.package@AbstractMethodError=AbstractMethodError",
- "scala.Predef$@String=String"
- ).map(scalaURL + "/index.html#" + _)
-
- def isExpectedExternalLink(l: EntityLink) = l.link match {
- case LinkToExternal(name, url) => assert(expectedUrls contains url, url); true
- case _ => false
- }
-
- assert(countLinks(test.comment.get, isExpectedExternalLink) == 8,
- countLinks(test.comment.get, isExpectedExternalLink) + " == 8")
- }
-}

0 comments on commit e1af973

Please sign in to comment.