From 1e74c644b1163948c389dd9082e0cba60ab5ed65 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 26 Feb 2015 17:30:11 +0100 Subject: don't generate links to builtin types in signatures --- src/Kotlin/DocumentationBuilder.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index da7552a7..b6bd8701 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -38,6 +38,9 @@ class DocumentationBuilder(val session: ResolveSession, val refGraph: NodeReferenceGraph, val logger: DokkaLogger) { val visibleToDocumentation = setOf(Visibilities.INTERNAL, Visibilities.PROTECTED, Visibilities.PUBLIC) + val boringBuiltinClasses = setOf( + "kotlin.Unit", "kotlin.Byte", "kotlin.Short", "kotlin.Int", "kotlin.Long", "kotlin.Char", "kotlin.Boolean", + "kotlin.Float", "kotlin.Double", "kotlin.String", "kotlin.Array", "kotlin.Any") fun parseDocumentation(descriptor: DeclarationDescriptor): Content { val kdoc = KDocFinder.findKDoc(descriptor) @@ -227,14 +230,18 @@ class DocumentationBuilder(val session: ResolveSession, if (prefix != "") { node.appendTextNode(prefix, Kind.Modifier) } - if (classifierDescriptor != null){} + if (classifierDescriptor != null && !classifierDescriptor.isBoringBuiltinClass()) { link(node, classifierDescriptor) + } append(node, DocumentationReference.Kind.Detail) for (typeArgument in jetType.getArguments()) node.appendProjection(typeArgument) } + fun ClassifierDescriptor.isBoringBuiltinClass(): Boolean = + DescriptorUtils.getFqName(this).asString() in boringBuiltinClasses + fun DocumentationNode.appendAnnotations(annotated: Annotated) { annotated.getAnnotations().forEach { val annotationNode = it.build() -- cgit