diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-01-16 19:08:57 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-01-31 14:32:37 +0100 |
commit | ab09530d350a2a7b2576d06a870082b975cf6c4f (patch) | |
tree | e4f3785d1584a9a4febde3616eb0a540783f0877 /doc-tool/src/dotty/tools/dottydoc/model/entities.scala | |
parent | 6f6dc9767badd4bcacd8f00ef0ed467bcabc6296 (diff) | |
download | dotty-ab09530d350a2a7b2576d06a870082b975cf6c4f.tar.gz dotty-ab09530d350a2a7b2576d06a870082b975cf6c4f.tar.bz2 dotty-ab09530d350a2a7b2576d06a870082b975cf6c4f.zip |
Add `TypeAlias` to docs
Diffstat (limited to 'doc-tool/src/dotty/tools/dottydoc/model/entities.scala')
-rw-r--r-- | doc-tool/src/dotty/tools/dottydoc/model/entities.scala | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala b/doc-tool/src/dotty/tools/dottydoc/model/entities.scala index aea09f745..6f6e8d3e8 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/entities.scala @@ -5,7 +5,7 @@ import comment._ import references._ import dotty.tools.dotc.core.Symbols.{ Symbol, NoSymbol } -trait Entity { +trait Entity { entity => def symbol: Symbol def name: String @@ -21,6 +21,12 @@ trait Entity { def annotations: List[String] + def children: List[Entity with Members] = entity match { + case e: Entity with Members => + e.members.collect { case e: Entity with Members if e.kind != "package" => e } + case _ => Nil + } + /** All parents from package level i.e. Package to Object to Member etc */ def parents: List[Entity] = parent match { case NonEntity => Nil @@ -72,8 +78,12 @@ trait ImplicitlyAddedEntity extends Entity { trait Package extends Entity with Members { val kind = "package" +} - def children: List[Entity with Members] +trait TypeAlias extends Entity with Modifiers { + val kind = "type" + def alias: Option[Reference] + def isAbstract: Boolean = !alias.isDefined } trait Class extends Entity with Modifiers with TypeParams with Constructors with SuperTypes with Members { |