diff options
Diffstat (limited to 'src/Kotlin')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 9 | ||||
-rw-r--r-- | src/Kotlin/KotlinLanguageService.kt | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index e77f97c9..0ad93801 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -270,8 +270,9 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati getConstructors() node.appendChildren(constructorsToDocument, DocumentationReference.Kind.Member) } - node.appendChildren(getDefaultType().getMemberScope().getAllDescriptors(), DocumentationReference.Kind.Member) - val classObjectDescriptor = getClassObjectDescriptor() + val members = getDefaultType().getMemberScope().getAllDescriptors().filter { it != getDefaultObjectDescriptor() } + node.appendChildren(members, DocumentationReference.Kind.Member) + val classObjectDescriptor = getDefaultObjectDescriptor() if (classObjectDescriptor != null) { node.appendChildren(classObjectDescriptor.getDefaultType().getMemberScope().getAllDescriptors(), DocumentationReference.Kind.Member) @@ -302,7 +303,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati } fun FunctionDescriptor.build(): DocumentationNode { - val node = DocumentationNode(this, if (inClassObject()) Kind.ClassObjectFunction else Kind.Function) + val node = DocumentationNode(this, if (inClassObject()) Kind.DefaultObjectFunction else Kind.Function) node.appendChildren(getTypeParameters(), DocumentationReference.Kind.Detail) getExtensionReceiverParameter()?.let { node.appendChild(it, DocumentationReference.Kind.Detail) } @@ -328,7 +329,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati } fun PropertyDescriptor.build(): DocumentationNode { - val node = DocumentationNode(this, if (inClassObject()) Kind.ClassObjectProperty else Kind.Property) + val node = DocumentationNode(this, if (inClassObject()) Kind.DefaultObjectProperty else Kind.Property) node.appendChildren(getTypeParameters(), DocumentationReference.Kind.Detail) getExtensionReceiverParameter()?.let { node.appendChild(it, DocumentationReference.Kind.Detail) } node.appendType(getReturnType()) diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index 526582e6..56baad58 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -26,10 +26,10 @@ class KotlinLanguageService : LanguageService { DocumentationNode.Kind.Modifier -> renderModifier(node) DocumentationNode.Kind.Constructor, DocumentationNode.Kind.Function, - DocumentationNode.Kind.ClassObjectFunction, + DocumentationNode.Kind.DefaultObjectFunction, DocumentationNode.Kind.PropertyAccessor -> renderFunction(node) DocumentationNode.Kind.Property, - DocumentationNode.Kind.ClassObjectProperty -> renderProperty(node) + DocumentationNode.Kind.DefaultObjectProperty -> renderProperty(node) else -> identifier(node.name) } } @@ -215,7 +215,7 @@ class KotlinLanguageService : LanguageService { when (node.kind) { DocumentationNode.Kind.Constructor -> identifier(node.owner!!.name) DocumentationNode.Kind.Function, - DocumentationNode.Kind.ClassObjectFunction -> keyword("fun ") + DocumentationNode.Kind.DefaultObjectFunction -> keyword("fun ") DocumentationNode.Kind.PropertyAccessor -> {} else -> throw IllegalArgumentException("Node $node is not a function-like object") } @@ -251,7 +251,7 @@ class KotlinLanguageService : LanguageService { renderAnnotationsForNode(node) when (node.kind) { DocumentationNode.Kind.Property, - DocumentationNode.Kind.ClassObjectProperty -> keyword("${node.getPropertyKeyword()} ") + DocumentationNode.Kind.DefaultObjectProperty -> keyword("${node.getPropertyKeyword()} ") else -> throw IllegalArgumentException("Node $node is not a property") } renderTypeParametersForNode(node) |