From 6d23430e9ebc6866d9c41523a1364cc9616e1222 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 13 Jan 2015 17:15:52 +0100 Subject: don't show methods as open if their containing class is final --- src/Kotlin/DocumentationBuilder.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 40c6d745..892a462e 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -71,7 +71,14 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati } fun DocumentationNode.appendModality(descriptor: MemberDescriptor) { - val modifier = descriptor.getModality().name().toLowerCase() + var modality = descriptor.getModality() + if (modality == Modality.OPEN) { + val containingClass = descriptor.getContainingDeclaration() as? ClassDescriptor + if (containingClass?.getModality() == Modality.FINAL) { + modality = Modality.FINAL + } + } + val modifier = modality.name().toLowerCase() val node = DocumentationNode(modifier, Content.Empty, DocumentationNode.Kind.Modifier) append(node, DocumentationReference.Kind.Detail) } -- cgit