summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/Settings.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-03-22 16:36:13 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2012-03-22 16:36:13 +0100
commit72c104b8b7b534c70ceaeca19a9239ce2410c76b (patch)
treeb7033fb3d53ef66276d5d7309a453f964f8e086e /src/compiler/scala/tools/nsc/doc/Settings.scala
parente2951867f51bf464b07f759662bfc50dfaf48e5b (diff)
downloadscala-72c104b8b7b534c70ceaeca19a9239ce2410c76b.tar.gz
scala-72c104b8b7b534c70ceaeca19a9239ce2410c76b.tar.bz2
scala-72c104b8b7b534c70ceaeca19a9239ce2410c76b.zip
Fixes SI-5593
After hours of debugging and understanding all the root causes why scaladoc is rummaging through the current directory for classes, I decided to treat the symptoms rather than the cause. I'll document the decision here in case anyone is interested: - in order to find documentable entities, scaladoc exhaustively looks at all the symbols starting from the root package and going all the way to the leaves, visiting all classes in the classpath - if the classpath is empty, scaladoc and scalac add "." as the default classpath. This leads to scaladoc going on a class hunting spree in the current directory. If it happens that the current directory contains package objects and they're not in the expected path (like scala.tools.nsc in build/quick/classes/.../nsc) errors start to pop up - scalac is also affected by this, but to a more limited scope, since it will lazily expand packages whenever necessary. To show this, run the repl in the root directory of the scala source code, after compiling scala: scala> import build.quick.classes.compiler.scala.tools.nsc._ error: error while loading package, class file './build/quick/classes/ compiler/scala/tools/nsc/package.class' contains wrong package package The cleanest solution I can see now is to look at the tree resulting from compilation and use it for guidance -- I will look into this.
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/Settings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/doc/Settings.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/Settings.scala b/src/compiler/scala/tools/nsc/doc/Settings.scala
index 6c74951156..45a2ad78b4 100644
--- a/src/compiler/scala/tools/nsc/doc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/doc/Settings.scala
@@ -97,4 +97,6 @@ class Settings(error: String => Unit) extends scala.tools.nsc.Settings(error) {
docformat, doctitle, docfooter, docversion, docUncompilable, docsourceurl, docgenerator
)
val isScaladocSpecific: String => Boolean = scaladocSpecific map (_.name)
+
+ override def isScaladoc = true
}