diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-06-24 15:19:05 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-06-24 18:10:42 +1000 |
commit | 1f7417c763fb199cacc6afedc6e54796916fd673 (patch) | |
tree | bd00d7e0e47be310172f01c758c01ca5430063c4 /src/scaladoc | |
parent | 73f40564a6b19e8b15f0908c3e24f1a8fe405605 (diff) | |
parent | 1b09e12ef3b3fea1cab56bac893295f74de23b8b (diff) | |
download | scala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.gz scala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.bz2 scala-1f7417c763fb199cacc6afedc6e54796916fd673.zip |
Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624
Diffstat (limited to 'src/scaladoc')
8 files changed, 18 insertions, 14 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index 44683f1755..067b2b2c29 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -143,7 +143,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) "dot" // by default, just pick up the system-wide dot ) - /** The maxium nuber of normal classes to show in the diagram */ + /** The maximum number of normal classes to show in the diagram */ val docDiagramsMaxNormalClasses = IntSetting( "-diagrams-max-classes", "The maximum number of superclasses or subclasses to show in a diagram", @@ -152,7 +152,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) _ => None ) - /** The maxium nuber of implcit classes to show in the diagram */ + /** The maximum number of implicit classes to show in the diagram */ val docDiagramsMaxImplicitClasses = IntSetting( "-diagrams-max-implicits", "The maximum number of implicitly converted classes to show in a diagram", diff --git a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala index 86155845b0..6cdd99c9ee 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala @@ -59,6 +59,7 @@ abstract class HtmlPage extends Page { thisPage => writeFile(site) { (w: Writer) => w.write(doctype.toString + "\n") w.write(xml.Xhtml.toXhtml(html)) + w.write('\n') } if (site.universe.settings.docRawOutput) diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala index 357c397f05..99f989aadf 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala @@ -177,7 +177,6 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show all</span></li> </ol> - <a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a> </div> } { diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala index b478c6424c..4c0ba32856 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala @@ -383,7 +383,7 @@ class DotDiagramGenerator(settings: doc.Settings, dotRunner: DotRunner) extends if (dotId.count(_ == '|') == 1) { val Array(klass, id) = dotId.toString.split("\\|") /* Sometimes dot "forgets" to add the image -- that's very annoying, but it seems pretty random, and simple - * tests like excute 20K times and diff the output don't trigger the bug -- so it's up to us to place the image + * tests like execute 20K times and diff the output don't trigger the bug -- so it's up to us to place the image * back in the node */ val kind = getKind(klass) if (kind != "") diff --git a/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala b/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala index 7fe8903c76..90de51d763 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala @@ -298,7 +298,7 @@ trait DocTemplateEntity extends MemberTemplateEntity { /** The shadowing information for the implicitly added members */ def implicitsShadowing: Map[MemberEntity, ImplicitMemberShadowing] - /** Classes that can be implcitly converted to this class */ + /** Classes that can be implicitly converted to this class */ def incomingImplicitlyConvertedClasses: List[(DocTemplateEntity, ImplicitConversion)] /** Classes to which this class can be implicitly converted to @@ -484,10 +484,10 @@ trait ImplicitConversion { /** The entity for the method that performed the conversion, if it's documented (or just its name, otherwise) */ def convertorMethod: Either[MemberEntity, String] - /** A short name of the convertion */ + /** A short name of the conversion */ def conversionShortName: String - /** A qualified name uniquely identifying the convertion (currently: the conversion method's qualified name) */ + /** A qualified name uniquely identifying the conversion (currently: the conversion method's qualified name) */ def conversionQualifiedName: String /** The entity that performed the conversion */ diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala index 96731acf56..178af3d4ba 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala @@ -478,7 +478,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { override lazy val comment = { def nonRootTemplate(sym: Symbol): Option[DocTemplateImpl] = if (sym eq RootPackage) None else findTemplateMaybe(sym) - /* Variable precendence order for implicitly added members: Take the variable defifinitions from ... + /* Variable precendence order for implicitly added members: Take the variable definitions from ... * 1. the target of the implicit conversion * 2. the definition template (owner) * 3. the current template diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala index f984b4579f..db39d059d7 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala @@ -90,8 +90,12 @@ trait ModelFactoryImplicitSupport { else { val context: global.analyzer.Context = global.analyzer.rootContext(NoCompilationUnit) - val results = global.analyzer.allViewsFrom(sym.tpe_*, context, sym.typeParams) + val results = global.analyzer.allViewsFrom(sym.tpe_*, context, sym.typeParams) ++ + global.analyzer.allViewsFrom(byNameType(sym.tpe_*), context, sym.typeParams) var conversions = results.flatMap(result => makeImplicitConversion(sym, result._1, result._2, context, inTpl)) + //debug(results.mkString("All views\n ", "\n ", "\n")) + //debug(conversions.mkString("Conversions\n ", "\n ", "\n")) + // also keep empty conversions, so they appear in diagrams // conversions = conversions.filter(!_.members.isEmpty) @@ -193,7 +197,7 @@ trait ModelFactoryImplicitSupport { List(new ImplicitConversionImpl(sym, result.tree.symbol, toType, constraints, inTpl)) } catch { case i: ImplicitNotFound => - //println(" Eliminating: " + toType) + //debug(s" Eliminating: $toType") Nil } } @@ -396,7 +400,7 @@ trait ModelFactoryImplicitSupport { def isHiddenConversion = settings.hiddenImplicits(conversionQualifiedName) - override def toString = "Implcit conversion from " + sym.tpe + " to " + toType + " done by " + convSym + override def toString = "Implicit conversion from " + sym.tpe + " to " + toType + " done by " + convSym } /* ========================= HELPER METHODS ========================== */ @@ -475,7 +479,7 @@ trait ModelFactoryImplicitSupport { } /** - * Make implicits explicit - Not used curently + * Make implicits explicit - Not used currently */ // object implicitToExplicit extends TypeMap { // def apply(tp: Type): Type = mapOver(tp) match { @@ -557,7 +561,7 @@ trait ModelFactoryImplicitSupport { * * The trick here is that the resultType does not matter - the condition for removal it that paramss have the same * structure (A => B => C may not override (A, B) => C) and that all the types involved are - * of the implcit conversion's member are subtypes of the parent members' parameters */ + * of the implicit conversion's member are subtypes of the parent members' parameters */ def isDistinguishableFrom(t1: Type, t2: Type): Boolean = { // Vlad: I tried using matches but it's not exactly what we need: // (p: AnyRef)AnyRef matches ((t: String)AnyRef returns false -- but we want that to be true diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala index 87d7ece8f2..093899231e 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala @@ -51,7 +51,7 @@ trait DiagramFactory extends DiagramDirectiveParser { case p: (TemplateEntity, TypeEntity) if !classExcluded(p._1) => NormalNode(p._2, Some(p._1))() }.reverse - // incoming implcit conversions + // incoming implicit conversions lazy val incomingImplicitNodes = tpl.incomingImplicitlyConvertedClasses.map { case (incomingTpl, conv) => ImplicitNode(makeType(incomingTpl.sym.tpe, tpl), Some(incomingTpl))(implicitTooltip(from=incomingTpl, to=tpl, conv=conv)) |