diff options
author | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-07-06 13:34:25 +0000 |
---|---|---|
committer | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-07-06 13:34:25 +0000 |
commit | 302f9fb68afd6fb88373e41ebf219ba55f07a463 (patch) | |
tree | 3b5c778a1c2ebae2f5a7f9f1210f4f8ccb9c14b1 | |
parent | 321439e32f89af71ec5d663337cbe379c306c422 (diff) | |
download | scala-302f9fb68afd6fb88373e41ebf219ba55f07a463.tar.gz scala-302f9fb68afd6fb88373e41ebf219ba55f07a463.tar.bz2 scala-302f9fb68afd6fb88373e41ebf219ba55f07a463.zip |
Adds support for @throws in ScalaDoc.
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Template.scala | 11 |
1 files changed, 10 insertions, 1 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 40e0ca930a..f296a932f4 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -425,7 +425,16 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { }</dd> } else NodeSeq.Empty - example ++ version ++ sinceVersion ++ note ++ seeAlso + val exceptions: Seq[scala.xml.Node] = + if(!comment.throws.isEmpty && !isReduced) { + <dt>Exceptions thrown</dt> + <dd>{ + val exceptionsXml: Iterable[scala.xml.NodeSeq] = (for(exception <- comment.throws ) yield <span class="cmt">{Text(exception._1) ++ bodyToHtml(exception._2)}</span> ) + exceptionsXml.reduceLeft(_ ++ Text("") ++ _) + }</dd> + } else NodeSeq.Empty + + example ++ version ++ sinceVersion ++ exceptions ++ note ++ seeAlso case None => NodeSeq.Empty } |