aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-21 18:58:06 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-21 18:58:06 +0300
commit46af59cc658e4f56b6d2909ab4dc93f43af77dc2 (patch)
tree3f3c104edaca1ade0d0472d417b89fce53eefc96 /core/src/main/kotlin/Kotlin
parentb6d79cf83917e6a8c843209df3ffa7d9e54d0917 (diff)
downloaddokka-46af59cc658e4f56b6d2909ab4dc93f43af77dc2.tar.gz
dokka-46af59cc658e4f56b6d2909ab4dc93f43af77dc2.tar.bz2
dokka-46af59cc658e4f56b6d2909ab4dc93f43af77dc2.zip
Auto-expand type-aliases excluded from documentation
Diffstat (limited to 'core/src/main/kotlin/Kotlin')
-rw-r--r--core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt
index 24f50dac..ffef399d 100644
--- a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt
+++ b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt
@@ -4,7 +4,10 @@ import com.google.inject.Inject
import org.jetbrains.dokka.Model.DescriptorSignatureProvider
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
+import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
import org.jetbrains.kotlin.idea.kdoc.resolveKDocLink
+import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyPrivateApi
+import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyPublicApi
class DeclarationLinkResolver
@Inject constructor(val resolutionFacade: DokkaResolutionFacade,
@@ -32,13 +35,13 @@ class DeclarationLinkResolver
return ContentExternalLink(externalHref)
}
val signature = descriptorSignatureProvider.signature(symbol)
- val referencedAt = fromDescriptor.sourceLocation()?.let { ", referenced at $it" }.orEmpty()
+ val referencedAt = fromDescriptor.signatureWithSourceLocation()
return ContentNodeLazyLink(href, { ->
val target = refGraph.lookup(signature)
if (target == null) {
- logger.warn("Can't find node by signature $signature$referencedAt")
+ logger.warn("Can't find node by signature $signature, referenced at $referencedAt")
}
target
})
@@ -63,6 +66,9 @@ class DeclarationLinkResolver
if (symbol is CallableMemberDescriptor && symbol.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
return symbol.overriddenDescriptors.firstOrNull()
}
+ if (symbol is TypeAliasDescriptor && !symbol.isDocumented(options)) {
+ return symbol.classDescriptor
+ }
return symbol
}