aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt9
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt15
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt1
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt7
4 files changed, 19 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
index c40c5b7c..d87152d5 100644
--- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
@@ -34,10 +34,9 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
private fun signature(c: DClasslike) = contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace)) {
platformText(c.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " }
if (c is DClass) {
- if (c.extra[AdditionalModifiers]?.content?.contains(ExtraModifiers.DATA) == true) {
- text("data ")
- } else {
- text(c.modifier.name + " ")
+ platformText(c.modifier){
+ if (c.extra[AdditionalModifiers]?.content?.contains(ExtraModifiers.DATA) == true && it.name == "final") "data "
+ else it.name + " "
}
}
when (c) {
@@ -72,7 +71,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
private fun signature(f: DFunction) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) {
platformText(f.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " }
- text(f.modifier.name + " ")
+ platformText(f.modifier) { it.name }
text("fun ")
list(f.generics, prefix = "<", suffix = "> ") {
+buildSignature(it)
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index ccee7269..bed6c25c 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -233,7 +233,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
else PlatformDependent.from(platformData,info.supertypes),
generics = descriptor.typeConstructor.parameters.map { it.toTypeParameter() },
documentation = info.docs,
- modifier = descriptor.modifier(),
+ modifier = if(isExpect) PlatformDependent.expectFrom(descriptor.modifier())
+ else PlatformDependent.from(platformData, descriptor.modifier()),
companion = descriptor.companion(driWithPlatform),
platformData = listOf(platformData),
extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations())
@@ -261,7 +262,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
visibility = if(isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility())
else PlatformDependent.from(platformData,descriptor.visibility.toDokkaVisibility()),
documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null),
- modifier = descriptor.modifier(),
+ modifier = if(isExpect) PlatformDependent.expectFrom(descriptor.modifier())
+ else PlatformDependent.from(platformData, descriptor.modifier()),
type = descriptor.returnType!!.toBound(),
platformData = listOf(platformData),
extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations())
@@ -288,7 +290,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
else PlatformDependent.from(platformData,descriptor.visibility.toDokkaVisibility()),
generics = descriptor.typeParameters.map { it.toTypeParameter() },
documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null),
- modifier = descriptor.modifier(),
+ modifier = if(isExpect) PlatformDependent.expectFrom(descriptor.modifier())
+ else PlatformDependent.from(platformData, descriptor.modifier()),
type = descriptor.returnType!!.toBound(),
platformData = listOf(platformData),
extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations())
@@ -315,7 +318,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
else PlatformDependent.from(platformData,descriptor.visibility.toDokkaVisibility()),
documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null),
type = descriptor.returnType.toBound(),
- modifier = descriptor.modifier(),
+ modifier = if(isExpect) PlatformDependent.expectFrom(descriptor.modifier())
+ else PlatformDependent.from(platformData, descriptor.modifier()),
generics = descriptor.typeParameters.map { it.toTypeParameter() },
platformData = listOf(platformData),
extra = PropertyContainer.withAll<DFunction>(descriptor.additionalExtras(), descriptor.getAnnotations()).let {
@@ -377,7 +381,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null),
type = descriptor.returnType!!.toBound(),
generics = descriptor.typeParameters.map { it.toTypeParameter() },
- modifier = descriptor.modifier(),
+ modifier = if(isExpect) PlatformDependent.expectFrom(descriptor.modifier())
+ else PlatformDependent.from(platformData, descriptor.modifier()),
receiver = descriptor.extensionReceiverParameter?.let {
visitReceiverParameterDescriptor(
it,
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 3f3ebe3a..b9e02398 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -166,6 +166,7 @@ open class DefaultPageCreator(
protected open fun contentForFunction(f: DFunction) = contentBuilder.contentFor(f) {
header(1) { text(f.name) }
platformDependentHint(f.dri, f.platformData.toSet()){
+ if(f.sources.expect != null) text("actual")
+buildSignature(f)
+contentForComments(f)
}
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 218f8c82..ee862fb8 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -122,6 +122,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
val classlikes = innerClasses.map { parseClasslike(it, dri) }
val visibility = getVisibility().toPlatformDependant()
val ancestors = ancestorsSet.toList().toPlatformDependant()
+ val modifiers = getModifier().toPlatformDependant()
return when {
isAnnotationType ->
DAnnotation(
@@ -193,7 +194,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
mapTypeParameters(dri),
ancestors,
documentation,
- getModifier(),
+ modifiers,
listOf(platformData),
PropertyContainer.empty<DClass>() + annotations.toList().toExtra()
)
@@ -226,7 +227,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
psi.returnType?.let { getBound(type = it) } ?: Void,
psi.mapTypeParameters(dri),
null,
- psi.getModifier(),
+ psi.getModifier().toPlatformDependant(),
listOf(platformData),
PropertyContainer.withAll(
InheritedFunction(isInherited),
@@ -339,7 +340,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
null,
accessors.firstOrNull { it.hasParameters() }?.let { parseFunction(it, parent) },
accessors.firstOrNull { it.returnType == psi.type }?.let { parseFunction(it, parent) },
- psi.getModifier(),
+ psi.getModifier().toPlatformDependant(),
listOf(platformData),
PropertyContainer.empty<DProperty>() + psi.annotations.toList().toExtra()
)