summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/model/Entity.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-07-16 23:12:35 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-17 14:20:13 +0200
commitdac4e8f543a8e2e3bacf447d327fc8a7e99acb49 (patch)
tree31c720a63ef9edd1608b7ed6511d2a6dfa77964d /src/compiler/scala/tools/nsc/doc/model/Entity.scala
parent17f745d33cbda90aa552c95bc5456ed793180333 (diff)
downloadscala-dac4e8f543a8e2e3bacf447d327fc8a7e99acb49.tar.gz
scala-dac4e8f543a8e2e3bacf447d327fc8a7e99acb49.tar.bz2
scala-dac4e8f543a8e2e3bacf447d327fc8a7e99acb49.zip
SI-5784 Scaladoc: {Abstract,Alias} type templates
Normally scaladoc won't generate template pages for anything other than packages, classes, traits and objects. But using the @template annotation on {abstract,alias} types, they get their own page and take part as full members in the diagrams. Furthermore, when looking for the companion object, if a value of type T is in scope, T will be taken as the companion object (even though it might be a class) All templates, including types are listed on the left navigation pane, so now adding @template to String can get scaladoc to generate (a no-comments) page for java.lang.String. The {abstract, alias} type icons need to be updated -- I just took the class icons and added a small x to them -- but they shoud be something else (maybe an underscore?)i TO USE THIS PATCH: <pre> /** @contentDiagram */ // tells scaladoc to create a diagram of the // templates contained in trait Base trait Base { /** @template */ // tells scaladoc to create a page for Foo type T < Foo trait Foo { def foo: Int } } /** @contentDiagram */ trait Api extends Base { /** @template */ override type T <: FooApi trait FooApi extends Foo { def bar: String } } </pre>
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/model/Entity.scala')
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/Entity.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/Entity.scala b/src/compiler/scala/tools/nsc/doc/model/Entity.scala
index 620aa4253f..0836d7e4da 100644
--- a/src/compiler/scala/tools/nsc/doc/model/Entity.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/Entity.scala
@@ -241,6 +241,11 @@ trait MemberTemplateEntity extends TemplateEntity with MemberEntity with HigherK
/** The value parameters of this case class, or an empty list if this class is not a case class. As case class value
* parameters cannot be curried, the outer list has exactly one element. */
def valueParams: List[List[ValueParam]]
+
+ /** The direct super-type of this template
+ e.g: {{{class A extends B[C[Int]] with D[E]}}} will have two direct parents: class B and D
+ NOTE: we are dropping the refinement here! */
+ def parentTypes: List[(TemplateEntity, TypeEntity)]
}
/** A template (class, trait, object or package) for which documentation is available. Only templates for which
@@ -259,11 +264,6 @@ trait DocTemplateEntity extends MemberTemplateEntity {
* only if the `docsourceurl` setting has been set. */
def sourceUrl: Option[java.net.URL]
- /** The direct super-type of this template
- e.g: {{{class A extends B[C[Int]] with D[E]}}} will have two direct parents: class B and D
- NOTE: we are dropping the refinement here! */
- def parentTypes: List[(TemplateEntity, TypeEntity)]
-
/** All class, trait and object templates which are part of this template's linearization, in lineratization order.
* This template's linearization contains all of its direct and indirect super-classes and super-traits. */
def linearizationTemplates: List[TemplateEntity]