diff options
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 3 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 20 |
2 files changed, 19 insertions, 4 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 5c08e47e..0f9e1404 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -344,7 +344,8 @@ enum class FunctionModifiers { enum class ExtraModifiers { STATIC, INLINE, INFIX, SUSPEND, REIFIED, CROSSINLINE, NOINLINE, - OVERRIDE, DATA, CONST, DYNAMIC, EXTERNAL, INNER, LATEINIT, OPERATOR, TAILREC, VARARG + OVERRIDE, DATA, CONST, DYNAMIC, EXTERNAL, INNER, LATEINIT, OPERATOR, TAILREC, VARARG, + NATIVE, SYNCHRONIZED, STRICTFP, TRANSIENT, VOLATILE, TRANSITIVE } private fun String.shorten(maxLength: Int) = lineSequence().first().let { diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 35bbd05e..c6e3177b 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -244,12 +244,26 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { null, psi.getModifier(), listOf(platformData), - PropertyContainer.empty<DFunction>() - + InheritedFunction(isInherited) - + psi.annotations.toList().toExtra() + PropertyContainer.withAll( + InheritedFunction(isInherited), + psi.annotations.toList().toExtra(), + psi.additionalExtras() + ) ) } + private fun PsiMethod.additionalExtras() = AdditionalModifiers( + listOfNotNull( + ExtraModifiers.STATIC.takeIf { hasModifier(JvmModifier.STATIC) }, + ExtraModifiers.NATIVE.takeIf { hasModifier(JvmModifier.NATIVE) }, + ExtraModifiers.SYNCHRONIZED.takeIf { hasModifier(JvmModifier.SYNCHRONIZED) }, + ExtraModifiers.STRICTFP.takeIf { hasModifier(JvmModifier.STRICTFP) }, + ExtraModifiers.TRANSIENT.takeIf { hasModifier(JvmModifier.TRANSIENT) }, + ExtraModifiers.VOLATILE.takeIf { hasModifier(JvmModifier.VOLATILE) }, + ExtraModifiers.TRANSITIVE.takeIf { hasModifier(JvmModifier.TRANSITIVE) } + ).toSet() + ) + private fun getBound(type: PsiType): Bound = cachedBounds.getOrPut(type.canonicalText) { when (type) { |