aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-03-04 17:04:50 +0100
committerKamil Doległo <kamilok1965@users.noreply.github.com>2020-03-04 18:00:19 +0100
commitfc875fe5f8bc52ac75053db097b3349465705732 (patch)
treea2e3291170b88336c906210c5570081a217326b4 /plugins/base
parentea0945efe8c7b5dd9aabc4f049afaac612b70422 (diff)
downloaddokka-fc875fe5f8bc52ac75053db097b3349465705732.tar.gz
dokka-fc875fe5f8bc52ac75053db097b3349465705732.tar.bz2
dokka-fc875fe5f8bc52ac75053db097b3349465705732.zip
Refactor Modifiers
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt10
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt6
3 files changed, 10 insertions, 10 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
index 97445b2b..c8a5105d 100644
--- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
@@ -29,7 +29,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
private fun signature(c: Classlike) = contentBuilder.contentFor(c, ContentKind.Symbol) {
platformText(c.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " }
if (c is Class) {
- text(c.modifier.toString() + " ")
+ text(c.modifier.name + " ")
}
when (c) {
is Class -> text("class ")
@@ -50,7 +50,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
private fun signature(f: Function) = contentBuilder.contentFor(f, ContentKind.Symbol) {
platformText(f.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " }
- text(f.modifier.toString().toLowerCase() + " ")
+ text(f.modifier.name + " ")
text("fun ")
f.receiver?.also {
type(it.type)
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index f30ffa00..29441ac1 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -434,11 +434,11 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
}
fun MemberDescriptor.modifier() = when (modality) {
- Modality.FINAL -> WithAbstraction.Modifier.Final
- Modality.SEALED -> WithAbstraction.Modifier.Sealed
- Modality.OPEN -> WithAbstraction.Modifier.Open
- Modality.ABSTRACT -> WithAbstraction.Modifier.Abstract
- else -> WithAbstraction.Modifier.Empty
+ Modality.FINAL -> KotlinModifier.Final
+ Modality.SEALED -> KotlinModifier.Sealed
+ Modality.OPEN -> KotlinModifier.Open
+ Modality.ABSTRACT -> KotlinModifier.Abstract
+ else -> KotlinModifier.Empty
}
private fun MemberDescriptor.createSources(): PlatformDependent<DocumentableSource> = if (isExpect()) {
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 6b25639f..81de12eb 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -243,9 +243,9 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
}
private fun PsiModifierListOwner.getModifier() = when {
- hasModifier(JvmModifier.ABSTRACT) -> WithAbstraction.Modifier.Abstract
- hasModifier(JvmModifier.FINAL) -> WithAbstraction.Modifier.Final
- else -> WithAbstraction.Modifier.Empty
+ hasModifier(JvmModifier.ABSTRACT) -> JavaModifier.Abstract
+ hasModifier(JvmModifier.FINAL) -> JavaModifier.Final
+ else -> JavaModifier.Empty
}
private fun PsiTypeParameterListOwner.mapTypeParameters(dri: DRI): List<TypeParameter> {