summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-07-19 15:03:13 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-19 15:05:10 +0200
commit6539a9ddc5ecdec65ef1d874999a200cee46b2c4 (patch)
tree7637fe42a15336de8b4c39087ea6de2915cca14c
parent0d367d4794e45ef021d9dfc7eeca186ba9fb632a (diff)
downloadscala-6539a9ddc5ecdec65ef1d874999a200cee46b2c4.tar.gz
scala-6539a9ddc5ecdec65ef1d874999a200cee46b2c4.tar.bz2
scala-6539a9ddc5ecdec65ef1d874999a200cee46b2c4.zip
SI-5784 Scaladoc: Type templates
@template and @documentable are now synomims.
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala3
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala2
-rw-r--r--test/scaladoc/resources/SI-5784.scala4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
index eba3e080ef..af33911681 100644
--- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -1075,6 +1075,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
// whether or not to create a page for an {abstract,alias} type
def typeShouldDocument(bSym: Symbol, inTpl: DocTemplateImpl) =
(settings.docExpandAllTypes.value && (bSym.sourceFile != null)) ||
- global.expandedDocComment(bSym, inTpl.sym).contains("@template")
+ { val rawComment = global.expandedDocComment(bSym, inTpl.sym)
+ rawComment.contains("@template") || rawComment.contains("@documentable") }
}
diff --git a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
index ac737b6ee3..1a11964e37 100644
--- a/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/comment/CommentFactory.scala
@@ -383,7 +383,7 @@ trait CommentFactory { thisFactory: ModelFactory with CommentFactory with Member
case None => List.empty
}
- val stripTags=List(inheritDiagramTag, contentDiagramTag, SimpleTagKey("template"))
+ val stripTags=List(inheritDiagramTag, contentDiagramTag, SimpleTagKey("template"), SimpleTagKey("documentable"))
val tagsWithoutDiagram = tags.filterNot(pair => stripTags.contains(pair._1))
val bodyTags: mutable.Map[TagKey, List[Body]] =
diff --git a/test/scaladoc/resources/SI-5784.scala b/test/scaladoc/resources/SI-5784.scala
index 175cc3cf33..3731d4998c 100644
--- a/test/scaladoc/resources/SI-5784.scala
+++ b/test/scaladoc/resources/SI-5784.scala
@@ -8,7 +8,7 @@ package test.templates {
/** @contentDiagram */
trait Base {
- /** @template */
+ /** @documentable */
type String = test.templates.String
/** @template
* @inheritanceDiagram */
@@ -20,7 +20,7 @@ package test.templates {
/** @contentDiagram */
trait Api extends Base {
- /** @template
+ /** @documentable
* @inheritanceDiagram */
override type T <: FooApi
trait FooApi extends Foo { def bar: String }