diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 17:30:11 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 17:30:11 +0100 |
commit | 1e74c644b1163948c389dd9082e0cba60ab5ed65 (patch) | |
tree | 2a34e3148c9f10ec78a09e956c70a8ccb31cea3f /src | |
parent | f9b7ea8fa9da20f6758788dd4b2b24820825bc5e (diff) | |
download | dokka-1e74c644b1163948c389dd9082e0cba60ab5ed65.tar.gz dokka-1e74c644b1163948c389dd9082e0cba60ab5ed65.tar.bz2 dokka-1e74c644b1163948c389dd9082e0cba60ab5ed65.zip |
don't generate links to builtin types in signatures
Diffstat (limited to 'src')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 9 |
1 files changed, 8 insertions, 1 deletions
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() |