diff options
Diffstat (limited to 'src/Model/DocumentationModule.kt')
-rw-r--r-- | src/Model/DocumentationModule.kt | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Model/DocumentationModule.kt b/src/Model/DocumentationModule.kt index 1f30268e..6b2773ed 100644 --- a/src/Model/DocumentationModule.kt +++ b/src/Model/DocumentationModule.kt @@ -1,8 +1,8 @@ package org.jetbrains.dokka import org.jetbrains.jet.lang.resolve.BindingContext -import org.jetbrains.jet.lang.psi.JetFile import org.jetbrains.jet.lang.descriptors.* +import org.jetbrains.jet.lang.resolve.name.FqName public class DocumentationModule(val module: ModuleDescriptor) : DocumentationNode(module, "module", DocumentationContent.Empty, DocumentationNode.Kind.Module) { fun merge(other: DocumentationModule): DocumentationModule { @@ -13,15 +13,13 @@ public class DocumentationModule(val module: ModuleDescriptor) : DocumentationNo } } -fun BindingContext.createDocumentationModule(module: ModuleDescriptor, file: JetFile): DocumentationModule { - val packageFragment = getPackageFragment(file) +fun BindingContext.createDocumentationModule(module: ModuleDescriptor, packages: Set<FqName>): DocumentationModule { val documentationModule = DocumentationModule(module) - if (packageFragment == null) throw IllegalArgumentException("File $file should have package fragment") - val visitor = DocumentationNodeBuilder(this) - packageFragment.accept(DocumentationBuildingVisitor(this, visitor), documentationModule) - + for (packageName in packages) { + val pkg = module.getPackage(packageName) + pkg!!.accept(DocumentationBuildingVisitor(this, visitor), documentationModule) + } checkResolveChildren(documentationModule) - return documentationModule } |