aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt
index 6d9b5fd0..09bb2602 100644
--- a/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt
+++ b/core/src/main/kotlin/Formats/JavaLayoutHtml/JavaLayoutHtmlPackageListService.kt
@@ -3,6 +3,7 @@ package org.jetbrains.dokka.Formats
import org.jetbrains.dokka.*
import org.jetbrains.dokka.ExternalDocumentationLinkResolver.Companion.DOKKA_PARAM_PREFIX
import org.jetbrains.kotlin.descriptors.*
+import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject
import org.jetbrains.kotlin.types.KotlinType
@@ -33,7 +34,7 @@ class JavaLayoutHtmlPackageListService: PackageListService {
class JavaLayoutHtmlInboundLinkResolutionService(private val paramMap: Map<String, List<String>>) : InboundExternalLinkResolutionService {
private fun getContainerPath(symbol: DeclarationDescriptor): String? {
return when (symbol) {
- is PackageFragmentDescriptor -> symbol.fqName.asString() + "/"
+ is PackageFragmentDescriptor -> symbol.fqName.asString().replace('.', '/') + "/"
is ClassifierDescriptor -> getContainerPath(symbol.findPackage()) + symbol.nameWithOuter() + ".html"
else -> null
}
@@ -49,6 +50,7 @@ class JavaLayoutHtmlInboundLinkResolutionService(private val paramMap: Map<Strin
private fun getPagePath(symbol: DeclarationDescriptor): String? {
return when (symbol) {
is PackageFragmentDescriptor -> getContainerPath(symbol) + "package-summary.html"
+ is EnumEntrySyntheticClassDescriptor -> getContainerPath(symbol.containingDeclaration) + "#" + symbol.signatureForAnchorUrlEncoded()
is ClassifierDescriptor -> getContainerPath(symbol) + "#"
is FunctionDescriptor, is PropertyDescriptor -> getContainerPath(symbol.containingDeclaration!!) + "#" + symbol.signatureForAnchorUrlEncoded()
else -> null
@@ -88,6 +90,10 @@ class JavaLayoutHtmlInboundLinkResolutionService(private val paramMap: Map<Strin
}
return when(this) {
+ is EnumEntrySyntheticClassDescriptor -> buildString {
+ append("ENUM_VALUE:")
+ append(name.asString())
+ }
is FunctionDescriptor -> buildString {
appendReceiverAndCompanion(this@signatureForAnchor)
append(name.asString())