aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt5
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt5
2 files changed, 9 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
index 108cee78..ebea7183 100644
--- a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
+++ b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
@@ -5,6 +5,7 @@ import com.google.inject.Singleton
import com.intellij.psi.PsiMethod
import com.intellij.util.io.*
import org.jetbrains.kotlin.descriptors.*
+import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
import org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
import org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor
@@ -178,7 +179,9 @@ interface InboundExternalLinkResolutionService {
class Javadoc : InboundExternalLinkResolutionService {
override fun getPath(symbol: DeclarationDescriptor): String? {
- if (symbol is JavaClassDescriptor) {
+ if (symbol is EnumEntrySyntheticClassDescriptor) {
+ return getPath(symbol.containingDeclaration)?.let { it + "#" + symbol.name.asString() }
+ } else if (symbol is JavaClassDescriptor) {
return DescriptorUtils.getFqName(symbol).asString().replace(".", "/") + ".html"
} else if (symbol is JavaCallableMemberDescriptor) {
val containingClass = symbol.containingDeclaration as? JavaClassDescriptor ?: return null
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt
index f60969fc..f06f0e64 100644
--- a/core/src/test/kotlin/format/MarkdownFormatTest.kt
+++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt
@@ -419,6 +419,11 @@ class MarkdownFormatTest: FileGeneratorTestCase() {
verifyMarkdownNodeByName("companionImplements", "Foo")
}
+ @Test fun enumRef() {
+ verifyMarkdownNode("enumRef")
+ }
+
+
private fun buildMultiplePlatforms(path: String): DocumentationModule {
val module = DocumentationModule("test")
val options = DocumentationOptions(