diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 4 | ||||
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index be647e49..41deeed0 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -219,9 +219,9 @@ public abstract class StructuredFormatService(locationService: LocationService, val breakdownBySummary = members.groupBy { formatText(location, it.summary) } for ((summary, items) in breakdownBySummary) { val signatureTexts = items map { signature -> - val signature = languageService.render(signature, RenderMode.SUMMARY) + val signatureText = languageService.render(signature, RenderMode.SUMMARY) val signatureAsCode = ContentCode() - signatureAsCode.append(signature) + signatureAsCode.append(signatureText) formatText(location, signatureAsCode) } signatureTexts.subList(0, signatureTexts.size()-1).forEach { diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 3b7f25d6..e09d35bd 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka import com.intellij.openapi.util.text.StringUtil import com.intellij.psi.util.PsiTreeUtil import org.jetbrains.dokka.DocumentationNode.Kind -import org.jetbrains.eval4j.FieldDescription import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.Annotated @@ -207,7 +206,7 @@ class DocumentationBuilder(val session: ResolveSession, } private fun ignoreSupertype(superType: JetType): Boolean { - val superClass = superType.getConstructor()?.getDeclarationDescriptor() as? ClassDescriptor + val superClass = superType.getConstructor().getDeclarationDescriptor() as? ClassDescriptor if (superClass != null) { val fqName = DescriptorUtils.getFqNameSafe(superClass).asString() return fqName == "kotlin.Annotation" || fqName == "kotlin.Enum" || fqName == "kotlin.Any" @@ -282,9 +281,7 @@ class DocumentationBuilder(val session: ResolveSession, fun DocumentationNode.appendInPageChildren(descriptors: Iterable<DeclarationDescriptor>, kind: DocumentationReference.Kind) { descriptors.forEach { descriptor -> val node = appendChild(descriptor, kind) - if (node != null) { - node.addReferenceTo(this, DocumentationReference.Kind.TopLevelPage) - } + node?.addReferenceTo(this, DocumentationReference.Kind.TopLevelPage) } } @@ -520,7 +517,7 @@ class DocumentationBuilder(val session: ResolveSession, fun AnnotationDescriptor.build(): DocumentationNode? { val annotationClass = getType().getConstructor().getDeclarationDescriptor() - if (ErrorUtils.isError(annotationClass)) { + if (annotationClass == null || ErrorUtils.isError(annotationClass)) { return null } val node = DocumentationNode(annotationClass.getName().asString(), Content.Empty, DocumentationNode.Kind.Annotation) |