From 623cf222ca2ac5e8b9628af5927956ecb6d44d1e Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Tue, 31 May 2022 15:34:37 +0200 Subject: Fix gathering inherited properties (#2481) * Fix gathering inherited properties in PSI * Refacotr KaJ transformer. Change wrapping TagWrapper for getters and setters. * Add logic to merge inherited properties in kotlin from java sources. * Remove getters and setters from JvmField properties for DObject, DEnum, DInterface in KaJ. * Unify InheritedMember DRI logic. * Fix gathering docs obtained from inheriting java sources in descriptors * Apply requested changes. * Resolve rebase conflicts * Use 221 for qodana analysis * Move accessors generation into DefaultDescriptorToDocumentableTranslator * Fix special "is" case for accessors and refactor logic in general * Remove ambiguous import after rebasing * Remove unused imports and format code * Apply review comment suggestions * Preserve previously lost accessor lookalikes * Extract a variable and correct a typo Co-authored-by: Andrzej Ratajczak --- core/api/core.api | 7 +++++++ core/src/main/kotlin/model/JvmField.kt | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 core/src/main/kotlin/model/JvmField.kt (limited to 'core') diff --git a/core/api/core.api b/core/api/core.api index 2a35b178..11dd1c45 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -1820,6 +1820,13 @@ public final class org/jetbrains/dokka/model/JavaVisibility$Public : org/jetbrai public static final field INSTANCE Lorg/jetbrains/dokka/model/JavaVisibility$Public; } +public final class org/jetbrains/dokka/model/JvmFieldKt { + public static final field JVM_FIELD_CLASS_NAMES Ljava/lang/String; + public static final field JVM_FIELD_PACKAGE_NAME Ljava/lang/String; + public static final fun isJvmField (Lorg/jetbrains/dokka/links/DRI;)Z + public static final fun isJvmField (Lorg/jetbrains/dokka/model/Annotations$Annotation;)Z +} + public final class org/jetbrains/dokka/model/JvmNameKt { public static final fun isJvmName (Lorg/jetbrains/dokka/links/DRI;)Z public static final fun isJvmName (Lorg/jetbrains/dokka/model/Annotations$Annotation;)Z diff --git a/core/src/main/kotlin/model/JvmField.kt b/core/src/main/kotlin/model/JvmField.kt new file mode 100644 index 00000000..623115e0 --- /dev/null +++ b/core/src/main/kotlin/model/JvmField.kt @@ -0,0 +1,10 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.links.DRI + +const val JVM_FIELD_PACKAGE_NAME = "kotlin.jvm" +const val JVM_FIELD_CLASS_NAMES = "JvmField" + +fun DRI.isJvmField(): Boolean = packageName == JVM_FIELD_PACKAGE_NAME && classNames == JVM_FIELD_CLASS_NAMES + +fun Annotations.Annotation.isJvmField(): Boolean = dri.isJvmField() -- cgit