From 7fa258873eab770577879e9721c0864449ba1114 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 16 Feb 2017 21:28:16 +0300 Subject: Dokka now can detect and recognize SinceKotlin --- core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/src/main/kotlin/Kotlin') diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index afb95fe6..30c1413d 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -200,8 +200,12 @@ class DocumentationBuilder annotated.annotations.forEach { it.build()?.let { annotationNode -> val refKind = when { - it.isDocumented() && annotationNode.isDeprecation() -> RefKind.Deprecation - it.isDocumented() -> RefKind.Annotation + it.isDocumented() -> + when { + annotationNode.isDeprecation() -> RefKind.Deprecation + annotationNode.isSinceKotlin() -> RefKind.SinceKotlin + else -> RefKind.Annotation + } it.isHiddenInDocumentation() -> RefKind.HiddenAnnotation else -> return@forEach } @@ -221,6 +225,8 @@ class DocumentationBuilder fun DocumentationNode.isDeprecation() = name == "Deprecated" || name == "deprecated" + fun DocumentationNode.isSinceKotlin() = name == "SinceKotlin" && kind == NodeKind.Annotation + fun DocumentationNode.appendSourceLink(sourceElement: SourceElement) { appendSourceLink(sourceElement.getPsi(), options.sourceLinks) } -- cgit