aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
index ebea7183..e19ecf76 100644
--- a/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
+++ b/core/src/main/kotlin/Kotlin/ExternalDocumentationLinkResolver.kt
@@ -214,13 +214,11 @@ interface InboundExternalLinkResolutionService {
else return "$path/index.$extension"
}
- fun getPathWithoutExtension(symbol: DeclarationDescriptor): String {
- if (symbol.containingDeclaration == null)
- return identifierToFilename(symbol.name.asString())
- else if (symbol is PackageFragmentDescriptor) {
- return symbol.fqName.asString()
- } else {
- return getPathWithoutExtension(symbol.containingDeclaration!!) + '/' + identifierToFilename(symbol.name.asString())
+ private fun getPathWithoutExtension(symbol: DeclarationDescriptor): String {
+ return when {
+ symbol.containingDeclaration == null -> identifierToFilename(symbol.name.asString())
+ symbol is PackageFragmentDescriptor -> identifierToFilename(symbol.fqName.asString())
+ else -> getPathWithoutExtension(symbol.containingDeclaration!!) + '/' + identifierToFilename(symbol.name.asString())
}
}