aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2020-07-07 15:45:32 +0200
committerGitHub <noreply@github.com>2020-07-07 15:45:32 +0200
commit63823e14794136c23359aab9f40b8d8dcfe504dd (patch)
treef65f3aee6e6d4086bd217387116261a14de5a6cb /plugins/base/src/main
parent6c1403cd8ffab5e13f12a2744846a70b31710b09 (diff)
downloaddokka-63823e14794136c23359aab9f40b8d8dcfe504dd.tar.gz
dokka-63823e14794136c23359aab9f40b8d8dcfe504dd.tar.bz2
dokka-63823e14794136c23359aab9f40b8d8dcfe504dd.zip
Javadoc signature provider (#1041)
Javadoc signature provider #1025
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt3
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt15
2 files changed, 10 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
index 2a242948..689f6db5 100644
--- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
+++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
@@ -21,9 +21,6 @@ interface JvmSignatureUtils {
fun <T : Documentable> WithExtraProperties<T>.annotations(): SourceSetDependent<List<Annotations.Annotation>> =
extra[Annotations]?.content ?: emptyMap()
- private fun Annotations.Annotation.toSignatureString(): String =
- "@" + this.dri.classNames + "(" + this.params.entries.joinToString { it.key + "=" + it.value } + ")"
-
private fun PageContentBuilder.DocumentableContentBuilder.annotations(
d: Documentable,
ignored: Set<Annotations.Annotation>,
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 5a55e3ec..5e03be6e 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -317,10 +317,15 @@ class DefaultPsiToDocumentableTranslator(
is PsiClassReferenceType -> {
val resolved: PsiClass = type.resolve()
?: return UnresolvedBound(type.presentableText)
- if (resolved.qualifiedName == "java.lang.Object") {
- JavaObject
- } else {
- TypeConstructor(DRI.from(resolved), type.parameters.map { getProjection(it) })
+ when {
+ resolved.qualifiedName == "java.lang.Object" -> JavaObject
+ resolved is PsiTypeParameter && resolved.owner != null ->
+ OtherParameter(
+ declarationDRI = DRI.from(resolved.owner!!),
+ name = resolved.name.orEmpty()
+ )
+ else ->
+ TypeConstructor(DRI.from(resolved), type.parameters.map { getProjection(it) })
}
}
is PsiArrayType -> TypeConstructor(
@@ -443,7 +448,7 @@ class DefaultPsiToDocumentableTranslator(
attributes.filter { it !is KtLightAbstractAnnotation }.mapNotNull { it.attributeName to it.toValue() }
.toMap(),
(psiElement as PsiClass).annotations.any {
- hasQualifiedName("java.lang.annotation.Documented")
+ it.hasQualifiedName("java.lang.annotation.Documented")
}
)
}