summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/DocFactory.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-06-25 16:53:29 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-02 13:34:15 +0200
commitc11427c13e85ba6fb210c1f05724c21c8aeb4be3 (patch)
tree1bb7324483e1fad5446036eeaa121259108e19e3 /src/compiler/scala/tools/nsc/doc/DocFactory.scala
parent44ec110bf059a089f54c06469ff2a54275d0f05f (diff)
downloadscala-c11427c13e85ba6fb210c1f05724c21c8aeb4be3.tar.gz
scala-c11427c13e85ba6fb210c1f05724c21c8aeb4be3.tar.bz2
scala-c11427c13e85ba6fb210c1f05724c21c8aeb4be3.zip
Reorganized scaladoc model
Since the old model was "interruptible", it was prone to something similar to race conditions -- where the model was creating a template, that template creating was interrupted to creat another template, and so on until a cycle was hit -- then, the loop would be broken by returning the originally not-yet-finished template. Now everything happens in a depth-first order, starting from root, traversing packages and classes all the way to members. The previously interrupting operations are now grouped in two categories: - those that were meant to add entities, like inheriting a class from a template to the other (e.g. trait T { class C }; trait U extends T) => those were moved right after the core model creation - those that were meant to do lookups - like finding the companion object -- those were moved after the model creation and inheritance and are not allowed to create new documentable templates. Now, for the documentable templates we have: DocTemplateImpl - the main documentable template, it represents a Scala template (class, trait, object or package). It may only be created when modelFinished=false by methods in the modelCreation object NoDocTemplateMemberImpl - a non-documented (source not present) template that was inherited. May be used as a member, but does not get its own page NoDocTemplateImpl - a non-documented (source not present) template that may not be used as a member and does not get its own page For model users: you can use anything in the ModelFactory trait at will, but not from the modelCreation object -- that is reserved for the core model creation and using those functions may lead to duplicate templates, invalid links and other ugly problems.
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/DocFactory.scala')
-rw-r--r--src/compiler/scala/tools/nsc/doc/DocFactory.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/DocFactory.scala b/src/compiler/scala/tools/nsc/doc/DocFactory.scala
index e2e1ddf065..37e3b626e8 100644
--- a/src/compiler/scala/tools/nsc/doc/DocFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/DocFactory.scala
@@ -83,8 +83,8 @@ class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor
with model.ModelFactoryImplicitSupport
with model.comment.CommentFactory
with model.TreeFactory {
- override def templateShouldDocument(sym: compiler.Symbol) =
- extraTemplatesToDocument(sym) || super.templateShouldDocument(sym)
+ override def templateShouldDocument(sym: compiler.Symbol, inTpl: TemplateImpl) =
+ extraTemplatesToDocument(sym) || super.templateShouldDocument(sym, inTpl)
}
)