From 0298076ba9cf22b70b6c85846ad555e201ee95ee Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 20 Nov 2017 22:38:11 +0300 Subject: Support receiver reference --- core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 2 ++ core/src/test/kotlin/format/MarkdownFormatTest.kt | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'core/src') 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) -- cgit