summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 }