diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-19 16:03:53 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-19 16:03:53 +0200 |
commit | b0c7f0b257d86634bb344405273200310f8ba386 (patch) | |
tree | 14c7aad2686562c824b17246c795c0e28ae538c8 | |
parent | 6539a9ddc5ecdec65ef1d874999a200cee46b2c4 (diff) | |
download | scala-b0c7f0b257d86634bb344405273200310f8ba386.tar.gz scala-b0c7f0b257d86634bb344405273200310f8ba386.tar.bz2 scala-b0c7f0b257d86634bb344405273200310f8ba386.zip |
Scaladoc: Adressed @hubertp's comment on #925
And relaxed the groups name/description/priority search algorithm to
work for types.
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala index af33911681..00e6f3769e 100644 --- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala @@ -492,11 +492,10 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { if (entity != default) return entity } // query linearization - if (!sym.isAliasType && !sym.isAbstractType) - for (tpl <- linearizationTemplates.collect{ case dtpl: DocTemplateImpl if dtpl!=this => dtpl}) { - val entity = tpl.groupSearch(extractor, default) - if (entity != default) return entity - } + for (tpl <- linearizationTemplates.collect{ case dtpl: DocTemplateImpl if dtpl!=this => dtpl}) { + val entity = tpl.groupSearch(extractor, default) + if (entity != default) return entity + } default } @@ -601,9 +600,10 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { } /* ============== MAKER METHODS ============== */ - /** This method makes it easier to work with the different kinds of symbols created by scalac + /** This method makes it easier to work with the different kinds of symbols created by scalac by stripping down the + * package object abstraction and placing members directly in the package. * - * Okay, here's the explanation of what happens. The code: + * Here's the explanation of what we do. The code: * * package foo { * object `package` { @@ -612,17 +612,22 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { * } * * will yield this Symbol structure: - * - * +---------------+ +--------------------------+ - * | package foo#1 ----(1)---> module class foo#2 | - * +---------------+ | +----------------------+ | +-------------------------+ - * | | package object foo#3 ------(1)---> module class package#4 | - * | +----------------------+ | | +---------------------+ | - * +--------------------------+ | | class package$Bar#5 | | - * | +---------------------+ | - * +-------------------------+ + * +---------+ (2) + * | | + * +---------------+ +---------- v ------- | ---+ +--------+ (2) + * | package foo#1 <---(1)---- module class foo#2 | | | | + * +---------------+ | +------------------ | -+ | +------------------- v ---+ | + * | | package object foo#3 <-----(1)---- module class package#4 | | + * | +----------------------+ | | +---------------------+ | | + * +--------------------------+ | | class package$Bar#5 | | | + * | +----------------- | -+ | | + * +------------------- | ---+ | + * | | + * +--------+ * (1) sourceModule * (2) you get out of owners with .owner + * + * and normalizeTemplate(Bar.owner) will get us the package, instead of the module class of the package object. */ def normalizeTemplate(aSym: Symbol): Symbol = aSym match { case null | rootMirror.EmptyPackage | NoSymbol => |