aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-06-26 03:07:35 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-06-30 18:04:09 +0200
commitf35ebd7d322ee864ca5e183c7dd17a07df074028 (patch)
tree4c614667f2c84f55f2284718689433b0e4a1046f /plugins/base/src/main/kotlin
parent862a23e3561942417a50e15a09a233f364a4a204 (diff)
downloaddokka-f35ebd7d322ee864ca5e183c7dd17a07df074028.tar.gz
dokka-f35ebd7d322ee864ca5e183c7dd17a07df074028.tar.bz2
dokka-f35ebd7d322ee864ca5e183c7dd17a07df074028.zip
Fix primary constructor in signature
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt34
1 files changed, 18 insertions, 16 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
index 5a497878..493aa403 100644
--- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
@@ -159,22 +159,24 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
}
if (c is WithConstructors) {
val pConstructor = c.constructors.singleOrNull { it.extra[PrimaryConstructorExtra] != null }
- if (pConstructor?.annotations()?.values?.any { it.isNotEmpty() } == true) {
- text(nbsp.toString())
- annotationsInline(pConstructor)
- text("constructor")
- }
- list(
- pConstructor?.parameters.orEmpty(),
- "(",
- ")",
- ",",
- pConstructor?.sourceSets.orEmpty().toSet()
- ) {
- annotationsInline(it)
- text(it.name ?: "", styles = mainStyles.plus(TextStyle.Bold))
- text(": ")
- signatureForProjection(it.type)
+ if (pConstructor?.sourceSets?.contains(sourceSet) == true) {
+ if (pConstructor.annotations().values.any { it.isNotEmpty() }) {
+ text(nbsp.toString())
+ annotationsInline(pConstructor)
+ text("constructor")
+ }
+ list(
+ pConstructor.parameters,
+ "(",
+ ")",
+ ",",
+ pConstructor.sourceSets.toSet()
+ ) {
+ annotationsInline(it)
+ text(it.name ?: "", styles = mainStyles.plus(TextStyle.Bold))
+ text(": ")
+ signatureForProjection(it.type)
+ }
}
}
if (c is WithSupertypes) {