aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-20 22:38:11 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-20 22:38:11 +0300
commit0298076ba9cf22b70b6c85846ad555e201ee95ee (patch)
treec61dff4bfcb266d3da25fed2aedcf53e203acf46 /core/src
parentbd92d65eba154d756c47c0ea2f304db04ac0ffae (diff)
downloaddokka-0298076ba9cf22b70b6c85846ad555e201ee95ee.tar.gz
dokka-0298076ba9cf22b70b6c85846ad555e201ee95ee.tar.bz2
dokka-0298076ba9cf22b70b6c85846ad555e201ee95ee.zip
Support receiver reference
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt2
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt4
2 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index fddf0814..04993ad4 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -746,6 +746,7 @@ class DocumentationBuilder
val node = DocumentationNode(name.asString(), Content.Empty, NodeKind.Receiver)
node.appendType(type)
+ register(this, node)
return node
}
@@ -915,6 +916,7 @@ fun DeclarationDescriptor.signature(): String = when (this) {
is FunctionDescriptor -> containingDeclaration.signature() + "$" + name + parameterSignature()
is ValueParameterDescriptor -> containingDeclaration.signature() + "/" + name
is TypeParameterDescriptor -> containingDeclaration.signature() + "*" + name
+ is ReceiverParameterDescriptor -> containingDeclaration.signature() + "*" + name
else -> throw UnsupportedOperationException("Don't know how to calculate signature for $this")
}
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt
index fbebfbfd..97a8ad4b 100644
--- a/core/src/test/kotlin/format/MarkdownFormatTest.kt
+++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt
@@ -380,6 +380,10 @@ class MarkdownFormatTest {
verifyMarkdownNode("indentedCodeBlock")
}
+ @Test fun receiverReference() {
+ verifyMarkdownNode("receiverReference")
+ }
+
private fun buildMultiplePlatforms(path: String): DocumentationModule {
val module = DocumentationModule("test")
val options = DocumentationOptions("", "html", generateIndexPages = false, noStdlibLink = true)