From 21121ff62ea72523ed5ea6a906b2ce42e9e47f69 Mon Sep 17 00:00:00 2001 From: Pedro Furlanetto Date: Sat, 23 Apr 2011 21:11:32 +0000 Subject: Shows migration and it's message. --- .../scala/tools/nsc/doc/html/page/Template.scala | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index f3e197d0be..e87f297094 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -322,11 +322,10 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { val annotations: Seq[scala.xml.Node] = { // A list of annotations which don't show their arguments, e. g. because they are shown separately. - val annotationsWithHiddenArguments = List("deprecated", "Deprecated") + val annotationsWithHiddenArguments = List("deprecated", "Deprecated", "migration") - def showArguments(annotation: Annotation) = { + def showArguments(annotation: Annotation) = if (annotationsWithHiddenArguments.contains(annotation.qualifiedName)) false else true - } if (!mbr.annotations.isEmpty) {
Annotations
@@ -358,11 +357,21 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
{ bodyToHtml(mbr.deprecation.get) }
} + val migration: Seq[scala.xml.Node] = { + mbr.annotations.find(_.qualifiedName == "migration") match { + case None => NodeSeq.Empty + case Some(mig) => { +
Migration
+

{mig.arguments.view.map(_.value).drop(2).mkString(" ")}

+ } + } + } + val mainComment: Seq[scala.xml.Node] = mbr.comment match { case Some(comment) => val example = if(!comment.example.isEmpty && !isReduced) -
Example{ if (comment.example.length > 1) "s" else ""} : +
Example{ if (comment.example.length > 1) "s" else ""}:
    { val exampleXml: List[scala.xml.NodeSeq] = for(example <- comment.example ) yield @@ -399,7 +408,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { } // end attributes block vals --- - val attributesInfo = attributes ++ definitionClasses ++ selfType ++ annotations ++ sourceLink ++ deprecation ++ mainComment + val attributesInfo = attributes ++ definitionClasses ++ selfType ++ annotations ++ deprecation ++ migration ++ sourceLink ++ mainComment val attributesBlock = if (attributesInfo.isEmpty) NodeSeq.Empty -- cgit v1.2.3