diff options
Diffstat (limited to 'src/Kotlin/DocumentationContext.kt')
-rw-r--r-- | src/Kotlin/DocumentationContext.kt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Kotlin/DocumentationContext.kt b/src/Kotlin/DocumentationContext.kt index ec9e748f..1fada8b3 100644 --- a/src/Kotlin/DocumentationContext.kt +++ b/src/Kotlin/DocumentationContext.kt @@ -6,10 +6,23 @@ import org.jetbrains.jet.lang.resolve.scopes.JetScope import org.jetbrains.jet.lang.descriptors.ModuleDescriptor import org.jetbrains.jet.lang.resolve.name.FqName +/** + * Context for documentation generation. + * + * Holds information about relations between nodes and descriptors during documentation generation + * + * %bindingContext: symbol resolution context + */ public class DocumentationContext(val bindingContext: BindingContext) { val descriptorToNode = hashMapOf<DeclarationDescriptor, DocumentationNode>() val nodeToDescriptor = hashMapOf<DocumentationNode, DeclarationDescriptor>() + val relations = hashMapOf<DocumentationNode, DeclarationDescriptor>() + + fun attach(node: DocumentationNode, descriptor: DeclarationDescriptor) { + relations.put(node, descriptor) + } + fun register(descriptor: DeclarationDescriptor, node: DocumentationNode) { descriptorToNode.put(descriptor, node) nodeToDescriptor.put(node, descriptor) @@ -41,6 +54,8 @@ fun BindingContext.createDocumentationModule(name: String, pkg!!.accept(DocumentationBuildingVisitor(this, options, visitor), documentationModule) } + context.buildCrossReferences(documentationModule) + // TODO: Uncomment for resolve verification // checkResolveChildren(documentationModule) return documentationModule |