diff options
author | Pedro Furlanetto <pedrofurla@gmail.com> | 2011-04-23 21:11:32 +0000 |
---|---|---|
committer | Pedro Furlanetto <pedrofurla@gmail.com> | 2011-04-23 21:11:32 +0000 |
commit | 21121ff62ea72523ed5ea6a906b2ce42e9e47f69 (patch) | |
tree | 9f636c54d9efbca4c341c341e579b26c43295fb2 /src | |
parent | 50a4b393f7a5e30908d9591f3eb9343ae6861a0b (diff) | |
download | scala-21121ff62ea72523ed5ea6a906b2ce42e9e47f69.tar.gz scala-21121ff62ea72523ed5ea6a906b2ce42e9e47f69.tar.bz2 scala-21121ff62ea72523ed5ea6a906b2ce42e9e47f69.zip |
Shows migration and it's message.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Template.scala | 19 |
1 files 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) { <dt>Annotations</dt> @@ -358,11 +357,21 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { <dd class="cmt">{ bodyToHtml(mbr.deprecation.get) }</dd> } + val migration: Seq[scala.xml.Node] = { + mbr.annotations.find(_.qualifiedName == "migration") match { + case None => NodeSeq.Empty + case Some(mig) => { + <dt>Migration</dt> + <dd class="cmt"><p>{mig.arguments.view.map(_.value).drop(2).mkString(" ")}</p></dd> + } + } + } + val mainComment: Seq[scala.xml.Node] = mbr.comment match { case Some(comment) => val example = if(!comment.example.isEmpty && !isReduced) - <div class="block">Example{ if (comment.example.length > 1) "s" else ""} : + <div class="block">Example{ if (comment.example.length > 1) "s" else ""}: <ol>{ 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 |