diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-10-12 22:35:47 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-10-12 22:35:47 +0400 |
commit | 11355cefc9f6856054cb3760d2a339f40d22dae3 (patch) | |
tree | 8b3abf314cd517c7c0136ad5a2334b2140d69cf7 /src/Kotlin/DocumentationContext.kt | |
parent | cf272252a8e62d7b212e9025065a8bce4f514946 (diff) | |
download | dokka-11355cefc9f6856054cb3760d2a339f40d22dae3.tar.gz dokka-11355cefc9f6856054cb3760d2a339f40d22dae3.tar.bz2 dokka-11355cefc9f6856054cb3760d2a339f40d22dae3.zip |
Convert visitors to top-down builder
Diffstat (limited to 'src/Kotlin/DocumentationContext.kt')
-rw-r--r-- | src/Kotlin/DocumentationContext.kt | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Kotlin/DocumentationContext.kt b/src/Kotlin/DocumentationContext.kt index 95c3ded1..b13f08ea 100644 --- a/src/Kotlin/DocumentationContext.kt +++ b/src/Kotlin/DocumentationContext.kt @@ -47,16 +47,14 @@ fun BindingContext.createDocumentationModule(name: String, packages: Set<FqName>, options: DocumentationOptions = DocumentationOptions()): DocumentationModule { val documentationModule = DocumentationModule(name) - val context = DocumentationContext(this) - val visitor = DocumentationNodeBuilder(context) - for (packageName in packages) { - val pkg = module.getPackage(packageName) - pkg!!.accept(DocumentationBuildingVisitor(this, options, visitor), documentationModule) + val builder = DocumentationBuilder(this, options) + with(builder) { + for (packageName in packages) { + val pkg = module.getPackage(packageName) + if (pkg != null) + documentationModule.appendChild(pkg, DocumentationReference.Kind.Member) + } } - - context.resolveReferences(documentationModule) - - // TODO: Uncomment for resolve verification - // checkResolveChildren(documentationModule) + builder.resolveReferences(documentationModule) return documentationModule } |