From 36926eb866166d3751372322bfb4ed4471471f44 Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Fri, 20 Mar 2020 03:32:19 +0100 Subject: Adding missing extra modifiers for java functions --- .../psi/DefaultPsiToDocumentableTranslator.kt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'plugins/base') 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() - + 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) { -- cgit