diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-03-16 14:25:49 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2020-03-16 14:25:49 +0100 |
commit | cd38992a28a8b16cd91661f05829610d1373e47c (patch) | |
tree | aa2cd1357739f2dc350729a1c386e070525723f0 /plugins/kotlin-as-java/src | |
parent | e5a5f152c3ba9ee3d533ca35e62e45ac2e69ffe1 (diff) | |
download | dokka-cd38992a28a8b16cd91661f05829610d1373e47c.tar.gz dokka-cd38992a28a8b16cd91661f05829610d1373e47c.tar.bz2 dokka-cd38992a28a8b16cd91661f05829610d1373e47c.zip |
Fix Java signature generation
Diffstat (limited to 'plugins/kotlin-as-java/src')
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 284d6ab9..55dd7a97 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -23,6 +23,7 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge override fun signature(documentable: Documentable): ContentNode = when (documentable) { is Function -> signature(documentable) + is Property -> signature(documentable) is Classlike -> signature(documentable) is TypeParameter -> signature(documentable) else -> throw NotImplementedError( @@ -44,7 +45,7 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge is Object -> text("class ") is Annotation -> text("@interface ") } - text(c.name!!) + link(c.name!!, c.dri) if (c is WithGenerics) { list(c.generics, prefix = "<", suffix = ">") { +buildSignature(it) @@ -59,6 +60,10 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge } } + private fun signature(p: Property) = contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + signatureForProjection(p.type) + } + private fun signature(f: Function) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) { text(f.modifier.takeIf { it !in ignoredModifiers }?.name.orEmpty() + " ") val returnType = f.type |