diff options
author | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-13 17:32:39 +0100 |
---|---|---|
committer | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-13 17:32:39 +0100 |
commit | cd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8 (patch) | |
tree | 80ceae612c0ac3874fabdeef9230575ebc8ef1f2 /src | |
parent | ec6fcb4f0a00c66c410c2735af58bb0c5275f9a9 (diff) | |
parent | 6d23430e9ebc6866d9c41523a1364cc9616e1222 (diff) | |
download | dokka-cd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8.tar.gz dokka-cd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8.tar.bz2 dokka-cd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8.zip |
Merge pull request #13 from orangy/not-open
don't show methods as open if their containing class is final
Diffstat (limited to 'src')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 9 |
1 files changed, 8 insertions, 1 deletions
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) } |