diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala index eba3e080ef34..af3391168165 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 ac737b6ee316..1a11964e37f8 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 175cc3cf33bb..3731d4998c1e 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 }