diff options
Diffstat (limited to 'src/Model/DocumentationNodeBuilder.kt')
-rw-r--r-- | src/Model/DocumentationNodeBuilder.kt | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Model/DocumentationNodeBuilder.kt b/src/Model/DocumentationNodeBuilder.kt index 103e2e89..b079c499 100644 --- a/src/Model/DocumentationNodeBuilder.kt +++ b/src/Model/DocumentationNodeBuilder.kt @@ -10,17 +10,17 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitDeclarationDescriptor(descriptor: DeclarationDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Unknown, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.Unknown) data!!.addReferenceTo(node, DocumentationReferenceKind.Link) node.addReferenceTo(data, DocumentationReferenceKind.Owner) return node } override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor?, data: DocumentationNode?): DocumentationNode? { - val node = DocumentationNode(descriptor!!.getName().asString(), DocumentationContent.Empty, DocumentationNodeKind.Receiver, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor!!, descriptor.getName().asString(), DocumentationContent.Empty, DocumentationNodeKind.Receiver) data!!.addReferenceTo(node, DocumentationReferenceKind.Detail) - val typeNode = DocumentationNode(descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type, context.getResolutionScope(descriptor)) + val typeNode = DocumentationNode(descriptor, descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type) node.addReferenceTo(typeNode, DocumentationReferenceKind.Detail) node.addReferenceTo(data, DocumentationReferenceKind.Owner) @@ -29,10 +29,10 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Parameter, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.Parameter) data!!.addReferenceTo(node, DocumentationReferenceKind.Detail) - val typeNode = DocumentationNode(descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type, context.getResolutionScope(descriptor)) + val typeNode = DocumentationNode(descriptor, descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type) node.addReferenceTo(typeNode, DocumentationReferenceKind.Detail) node.addReferenceTo(data, DocumentationReferenceKind.Owner) @@ -41,11 +41,11 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitClassDescriptor(descriptor: ClassDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, when (descriptor.getKind()) { + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, when (descriptor.getKind()) { ClassKind.OBJECT -> DocumentationNodeKind.Object ClassKind.TRAIT -> DocumentationNodeKind.Trait else -> DocumentationNodeKind.Class - }, context.getResolutionScope(descriptor)) + }) data!!.addReferenceTo(node, DocumentationReferenceKind.Member) node.addReferenceTo(data, DocumentationReferenceKind.Owner) return node @@ -53,10 +53,10 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitFunctionDescriptor(descriptor: FunctionDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Function, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.Function) data!!.addReferenceTo(node, DocumentationReferenceKind.Member) - val typeNode = DocumentationNode(descriptor.getReturnType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type, context.getResolutionScope(descriptor)) + val typeNode = DocumentationNode(descriptor, descriptor.getReturnType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type) node.addReferenceTo(typeNode, DocumentationReferenceKind.Detail) node.addReferenceTo(data, DocumentationReferenceKind.Owner) @@ -65,19 +65,19 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.TypeParameter, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.TypeParameter) data!!.addReferenceTo(node, DocumentationReferenceKind.Detail) val builtIns = KotlinBuiltIns.getInstance() for (constraint in descriptor.getUpperBounds()) { if (constraint == builtIns.getDefaultBound()) continue - val constraintNode = DocumentationNode(constraint.toString(), DocumentationContent.Empty, DocumentationNodeKind.UpperBound, context.getResolutionScope(descriptor)) + val constraintNode = DocumentationNode(descriptor, constraint.toString(), DocumentationContent.Empty, DocumentationNodeKind.UpperBound) node.addReferenceTo(constraintNode, DocumentationReferenceKind.Detail) } for (constraint in descriptor.getLowerBounds()) { if (builtIns.isNothing(constraint)) continue - val constraintNode = DocumentationNode(constraint.toString(), DocumentationContent.Empty, DocumentationNodeKind.LowerBound, context.getResolutionScope(descriptor)) + val constraintNode = DocumentationNode(descriptor, constraint.toString(), DocumentationContent.Empty, DocumentationNodeKind.LowerBound) node.addReferenceTo(constraintNode, DocumentationReferenceKind.Detail) } node.addReferenceTo(data, DocumentationReferenceKind.Owner) @@ -86,10 +86,10 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitPropertyDescriptor(descriptor: PropertyDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Property, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.Property) data!!.addReferenceTo(node, DocumentationReferenceKind.Member) - val typeNode = DocumentationNode(descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type, context.getResolutionScope(descriptor)) + val typeNode = DocumentationNode(descriptor, descriptor.getType().toString(), DocumentationContent.Empty, DocumentationNodeKind.Type) node.addReferenceTo(typeNode, DocumentationReferenceKind.Detail) node.addReferenceTo(data, DocumentationReferenceKind.Owner) @@ -98,14 +98,14 @@ class DocumentationNodeBuilder(val context: BindingContext) : DeclarationDescrip override fun visitConstructorDescriptor(descriptor: ConstructorDescriptor?, data: DocumentationNode?): DocumentationNode? { val doc = context.getDocumentation(descriptor!!) - val node = DocumentationNode(descriptor.getName().asString(), doc, DocumentationNodeKind.Constructor, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor, descriptor.getName().asString(), doc, DocumentationNodeKind.Constructor) data!!.addReferenceTo(node, DocumentationReferenceKind.Member) node.addReferenceTo(data, DocumentationReferenceKind.Owner) return node } override fun visitPackageFragmentDescriptor(descriptor: PackageFragmentDescriptor?, data: DocumentationNode?): DocumentationNode? { - val node = DocumentationNode(descriptor!!.fqName.asString(), DocumentationContent.Empty, DocumentationNodeKind.Package, context.getResolutionScope(descriptor)) + val node = DocumentationNode(descriptor!!, descriptor.fqName.asString(), DocumentationContent.Empty, DocumentationNodeKind.Package) data!!.addReferenceTo(node, DocumentationReferenceKind.Member) node.addReferenceTo(data, DocumentationReferenceKind.Owner) return node |