aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt6
-rw-r--r--src/Kotlin/KotlinLanguageService.kt16
2 files changed, 18 insertions, 4 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 844d8290..121c44bf 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -127,7 +127,11 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
fun DocumentationNode.appendAnnotations(annotated: Annotated) {
annotated.getAnnotations().forEach {
- it.build()?.let { append(it, DocumentationReference.Kind.Annotation) }
+ val annotationNode = it.build()
+ if (annotationNode != null) {
+ append(annotationNode,
+ if (annotationNode.name == "deprecated") DocumentationReference.Kind.Deprecation else DocumentationReference.Kind.Annotation)
+ }
}
}
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt
index 92d5bf1d..2ed308f8 100644
--- a/src/Kotlin/KotlinLanguageService.kt
+++ b/src/Kotlin/KotlinLanguageService.kt
@@ -196,7 +196,7 @@ class KotlinLanguageService : LanguageService {
else -> throw IllegalArgumentException("Node $node is not a class-like object")
}
- identifier(node.name)
+ identifierOrDeprecated(node)
renderTypeParametersForNode(node)
renderSupertypesForNode(node)
}
@@ -218,7 +218,7 @@ class KotlinLanguageService : LanguageService {
}
if (node.kind != org.jetbrains.dokka.DocumentationNode.Kind.Constructor)
- identifier(node.name)
+ identifierOrDeprecated(node)
symbol("(")
renderList(node.details(DocumentationNode.Kind.Parameter)) {
@@ -246,8 +246,18 @@ class KotlinLanguageService : LanguageService {
symbol(".")
}
- identifier(node.name)
+ identifierOrDeprecated(node)
symbol(": ")
renderType(node.detail(DocumentationNode.Kind.Type))
}
+
+ fun ContentNode.identifierOrDeprecated(node: DocumentationNode) {
+ if (node.deprecation != null) {
+ val strike = ContentStrikethrough()
+ strike.identifier(node.name)
+ append(strike)
+ } else {
+ identifier(node.name)
+ }
+ }
} \ No newline at end of file