diff options
author | Goooler <wangzongler@gmail.com> | 2022-02-21 22:01:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 17:01:06 +0300 |
commit | f5b7797255576e5f1c230e2ca3fcb5f4e602387c (patch) | |
tree | 25fd98250066c4ed6c2fff1104be533604bbf1b9 /plugins/base/src/main/kotlin | |
parent | df4780c31026aaa626746f49f0e6fa3fa0278a05 (diff) | |
download | dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.tar.gz dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.tar.bz2 dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.zip |
Code cleanups (#2165)
Diffstat (limited to 'plugins/base/src/main/kotlin')
20 files changed, 42 insertions, 45 deletions
diff --git a/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt b/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt index 9122d8ee..f36071ff 100644 --- a/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt +++ b/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt @@ -5,9 +5,9 @@ package org.jetbrains.dokka.base.parsers.moduleAndPackage import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.analysis.from import org.jetbrains.dokka.base.parsers.MarkdownParser -import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.* +import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.Module +import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.Package import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.doc.Description import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.descriptors.ClassDescriptor diff --git a/plugins/base/src/main/kotlin/renderers/DefaultTabSortingStrategy.kt b/plugins/base/src/main/kotlin/renderers/DefaultTabSortingStrategy.kt index 3b849fec..056e0f93 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultTabSortingStrategy.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultTabSortingStrategy.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka.base.renderers import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.Kind -import org.jetbrains.dokka.utilities.DokkaLogger private val kindsOrder = listOf( ContentKind.Classlikes, diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 2d8f88a6..4dd020ce 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -29,11 +29,11 @@ open class HtmlRenderer( private val configuration = configuration<DokkaBase, DokkaBaseConfiguration>(context) private val sourceSetDependencyMap: Map<DokkaSourceSetID, List<DokkaSourceSetID>> = - context.configuration.sourceSets.map { sourceSet -> + context.configuration.sourceSets.associate { sourceSet -> sourceSet.sourceSetID to context.configuration.sourceSets .map { it.sourceSetID } .filter { it in sourceSet.dependentSourceSets } - }.toMap() + } private var shouldRenderSourceSetBubbles: Boolean = false @@ -180,7 +180,7 @@ open class HtmlRenderer( buildPlatformDependent( content.sourceSets.filter { sourceSetRestriction == null || it in sourceSetRestriction - }.map { it to setOf(content.inner) }.toMap(), + }.associateWith { setOf(content.inner) }, pageContext, content.extra, content.style diff --git a/plugins/base/src/main/kotlin/renderers/html/SearchbarDataInstaller.kt b/plugins/base/src/main/kotlin/renderers/html/SearchbarDataInstaller.kt index d8595863..dba6cced 100644 --- a/plugins/base/src/main/kotlin/renderers/html/SearchbarDataInstaller.kt +++ b/plugins/base/src/main/kotlin/renderers/html/SearchbarDataInstaller.kt @@ -18,7 +18,7 @@ data class SearchRecord( val location: String, val searchKeys: List<String> = listOf(name) ) { - companion object {} + companion object } open class SearchbarDataInstaller(val context: DokkaContext) : PageTransformer { diff --git a/plugins/base/src/main/kotlin/renderers/html/Tags.kt b/plugins/base/src/main/kotlin/renderers/html/Tags.kt index f79d1633..a23c7bf1 100644 --- a/plugins/base/src/main/kotlin/renderers/html/Tags.kt +++ b/plugins/base/src/main/kotlin/renderers/html/Tags.kt @@ -23,9 +23,8 @@ open class WBR(initialAttributes: Map<String, String>, consumer: TagConsumer<*>) @HtmlTagMarker inline fun FlowOrPhrasingContent.strike(classes : String? = null, crossinline block : STRIKE.() -> Unit = {}) : Unit = STRIKE(attributesMapOf("class", classes), consumer).visit(block) -open class STRIKE(initialAttributes : Map<String, String>, override val consumer : TagConsumer<*>) : HTMLTag("strike", consumer, initialAttributes, null, false, false), HtmlBlockInlineTag { - -} +open class STRIKE(initialAttributes: Map<String, String>, override val consumer: TagConsumer<*>) : + HTMLTag("strike", consumer, initialAttributes, null, false, false), HtmlBlockInlineTag fun FlowOrMetaDataContent.templateCommand(data: Command, block: TemplateBlock = {}): Unit = (consumer as? ImmediateResolutionTagConsumer)?.processCommand(data, block) diff --git a/plugins/base/src/main/kotlin/renderers/preprocessors.kt b/plugins/base/src/main/kotlin/renderers/preprocessors.kt index 1a41162d..8a30bed1 100644 --- a/plugins/base/src/main/kotlin/renderers/preprocessors.kt +++ b/plugins/base/src/main/kotlin/renderers/preprocessors.kt @@ -1,8 +1,12 @@ package org.jetbrains.dokka.base.renderers import org.jetbrains.dokka.base.resolvers.shared.LinkFormat -import org.jetbrains.dokka.model.withDescendants -import org.jetbrains.dokka.pages.* +import org.jetbrains.dokka.pages.ModulePage +import org.jetbrains.dokka.pages.RendererSpecificPage +import org.jetbrains.dokka.pages.RendererSpecificResourcePage +import org.jetbrains.dokka.pages.RendererSpecificRootPage +import org.jetbrains.dokka.pages.RenderingStrategy +import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt index c4c46331..cae0ccaf 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt @@ -96,7 +96,7 @@ open class DokkaLocationProvider( .mapNotNull { ssid -> dokkaContext.configuration.sourceSets.find { it.sourceSetID == ssid }?.toDisplaySourceSet() } - }.orEmpty() + } return allSourceSets.asSequence().mapNotNull { displaySourceSet -> pagesIndex[DRIWithSourceSets(dri, displaySourceSet)]?.let { page -> resolve(page, context) } diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 8d97701d..3c9daa29 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -377,7 +377,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog private fun PageContentBuilder.DocumentableContentBuilder.signatureForProjection( p: Projection, showFullyQualifiedName: Boolean = false - ): Unit { + ) { return when (p) { is TypeParameter -> { annotationsInline(p) diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt index bb350b34..0fea9132 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt @@ -26,9 +26,9 @@ object KotlinSignatureUtils : JvmSignatureUtils { annotationsInlineWithIgnored(d, ignoredAnnotations, strategy, listBrackets, classExtension) override fun <T : Documentable> WithExtraProperties<T>.modifiers() = - extra[AdditionalModifiers]?.content?.entries?.map { + extra[AdditionalModifiers]?.content?.entries?.associate { it.key to it.value.filterIsInstance<ExtraModifiers.KotlinOnlyModifiers>().toSet() - }?.toMap() ?: emptyMap() + } ?: emptyMap() val PrimitiveJavaType.dri: DRI get() = DRI("kotlin", name.capitalize()) diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index 61a7a6a2..6239ad6b 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -34,7 +34,7 @@ internal class DefaultDocumentableMerger(val context: DokkaContext) : Documentab it.sourceSetID in sourceSet.dependentSourceSets }.flatMap { getDependencies(it) } - return configuration.sourceSets.map { it to getDependencies(it) }.toMap() + return configuration.sourceSets.associateWith { getDependencies(it) } } private fun <T : Documentable> merge(elements: List<T>, reducer: (T, T) -> T): List<T> = @@ -104,8 +104,7 @@ internal class DefaultDocumentableMerger(val context: DokkaContext) : Documentab } val reducedToOneDocumentableWithActualSourceSetIds = groupedByOwnExpectWithActualSourceSetIds.map { it.first.reduce(reducer) to it.second } - val uniqueNamedDocumentables = reducedToOneDocumentableWithActualSourceSetIds.let(::mergeClashingElements) - return uniqueNamedDocumentables + return reducedToOneDocumentableWithActualSourceSetIds.let(::mergeClashingElements) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt index 181113ae..463ec419 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt @@ -49,7 +49,7 @@ class InheritorsExtractorTransformer : DocumentableTransformer { private fun Map<DokkaSourceSet, Map<DRI, List<DRI>>>.getForDRI(dri: DRI) = map { (v, k) -> v to k[dri] - }.map { (k, v) -> k to v.orEmpty() }.toMap() + }.associate { (k, v) -> k to v.orEmpty() } private fun DModule.generateInheritanceMap() = getInheritanceEntriesRec().filterNot { it.second.isEmpty() }.groupBy({ it.first }) { it.second } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt index 961d2aca..2a5fbc11 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.Annotations import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.ExceptionInSupertypes -import org.jetbrains.dokka.model.WithSupertypes import org.jetbrains.dokka.model.properties.WithExtraProperties fun <T> T.isDeprecated() where T : WithExtraProperties<out Documentable> = diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt index c1f1a7f5..fb8ce535 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt @@ -6,7 +6,6 @@ import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query -import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.transformers.pages.PageTransformer class PageMerger(context: DokkaContext) : PageTransformer { diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/DefaultSamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/DefaultSamplesTransformer.kt index cadd3de0..c5b0f221 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/DefaultSamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/DefaultSamplesTransformer.kt @@ -19,8 +19,7 @@ class DefaultSamplesTransformer(context: DokkaContext) : SamplesTransformer(cont private fun processSampleBody(psiElement: PsiElement): String = when (psiElement) { is KtDeclarationWithBody -> { - val bodyExpression = psiElement.bodyExpression - when (bodyExpression) { + when (val bodyExpression = psiElement.bodyExpression) { is KtBlockExpression -> bodyExpression.text.removeSurrounding("{", "}") else -> bodyExpression!!.text } diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt index 43252be3..3ff7a77d 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt @@ -46,8 +46,8 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { } } - private fun setUpAnalysis(context: DokkaContext) = context.configuration.sourceSets.map { sourceSet -> - sourceSet to if (sourceSet.samples.isEmpty()) context.plugin<DokkaBase>() + private fun setUpAnalysis(context: DokkaContext) = context.configuration.sourceSets.associateWith { sourceSet -> + if (sourceSet.samples.isEmpty()) context.plugin<DokkaBase>() .querySingle { kotlinAnalysis }[sourceSet] // from sourceSet.sourceRoots else AnalysisEnvironment(DokkaMessageCollector(context.logger), sourceSet.analysisPlatform).run { if (analysisPlatform == Platform.jvm) { @@ -63,7 +63,7 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { val (facade, _) = createResolutionFacade(environment) EnvironmentAndFacade(environment, facade) } - }.toMap() + } private fun ContentNode.addSample( contentPage: ContentPage, diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index f636f984..b6de9276 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -416,7 +416,7 @@ private class DokkaDescriptorVisitor( companion = descriptor.companion(driWithPlatform), sourceSets = setOf(sourceSet), isExpectActual = (isExpect || isActual), - extra = PropertyContainer.withAll<DClass>( + extra = PropertyContainer.withAll( descriptor.additionalExtras().toSourceSetDependent().toAdditionalModifiers(), descriptor.getAnnotations().toSourceSetDependent().toAnnotations(), ImplementedInterfaces(info.ancestry.allImplementedInterfaces().toSourceSetDependent()), @@ -667,7 +667,7 @@ private class DokkaDescriptorVisitor( sources = descriptor.createSources(), sourceSets = setOf(sourceSet), isExpectActual = (isExpect || isActual), - extra = PropertyContainer.withAll<DFunction>( + extra = PropertyContainer.withAll( descriptor.additionalExtras().toSourceSetDependent().toAdditionalModifiers(), descriptor.getAnnotations().toSourceSetDependent().toAnnotations() ) @@ -724,7 +724,7 @@ private class DokkaDescriptorVisitor( val enumEntries: List<ClassDescriptor> ) - private suspend fun MemberScope.getDescriptorsWithKind(shouldFilter: Boolean = false): DescriptorsWithKind { + private fun MemberScope.getDescriptorsWithKind(shouldFilter: Boolean = false): DescriptorsWithKind { val descriptors = getContributedDescriptors { true }.let { if (shouldFilter) it.filterDescriptorsInSourceSet() else it } @@ -820,7 +820,7 @@ private class DokkaDescriptorVisitor( ) ) - private suspend fun org.jetbrains.kotlin.descriptors.annotations.Annotations.getPresentableName(): String? = + private fun org.jetbrains.kotlin.descriptors.annotations.Annotations.getPresentableName(): String? = mapNotNull { it.toAnnotation() }.singleOrNull { it.dri.classNames == "ParameterName" }?.params?.get("name") .safeAs<StringValue>()?.value?.let { unquotedValue(it) } @@ -896,7 +896,7 @@ private class DokkaDescriptorVisitor( null } }, - kdocLocation = toSourceElement?.containingFile?.name?.let { + kdocLocation = toSourceElement.containingFile.name?.let { val fqName = fqNameOrNull()?.asString() if (fqName != null) "$it/$fqName" else it @@ -967,8 +967,8 @@ private class DokkaDescriptorVisitor( private suspend fun Annotated.getAnnotations() = annotations.parallelMapNotNull { it.toAnnotation() } - private fun ConstantValue<*>.toValue(): AnnotationParameterValue? = when (this) { - is ConstantsAnnotationValue -> value.toAnnotation()?.let { AnnotationValue(it) } + private fun ConstantValue<*>.toValue(): AnnotationParameterValue = when (this) { + is ConstantsAnnotationValue -> AnnotationValue(value.toAnnotation()) is ConstantsArrayValue -> ArrayValue(value.mapNotNull { it.toValue() }) is ConstantsEnumValue -> EnumValue( fullEnumEntryName(), @@ -1004,7 +1004,7 @@ private class DokkaDescriptorVisitor( DRI.from(annotationClass as DeclarationDescriptor), allValueArguments.map { it.key.asString() to it.value.toValue() }.filter { it.second != null - }.toMap() as Map<String, AnnotationParameterValue>, + }.toMap(), mustBeDocumented(), scope ) @@ -1031,16 +1031,16 @@ private class DokkaDescriptorVisitor( private fun ValueParameterDescriptor.getDefaultValue(): Expression? = ((source as? KotlinSourceElement)?.psi as? KtParameter)?.defaultValue?.toDefaultValueExpression() - private suspend fun PropertyDescriptor.getDefaultValue(): Expression? = + private fun PropertyDescriptor.getDefaultValue(): Expression? = (source as? KotlinSourceElement)?.psi?.children?.filterIsInstance<KtConstantExpression>()?.firstOrNull() ?.toDefaultValueExpression() - private suspend fun ClassDescriptor.getAppliedConstructorParameters() = + private fun ClassDescriptor.getAppliedConstructorParameters() = (source as PsiSourceElement).psi?.children?.flatMap { it.safeAs<KtInitializerList>()?.initializersAsExpression().orEmpty() }.orEmpty() - private suspend fun KtInitializerList.initializersAsExpression() = + private fun KtInitializerList.initializersAsExpression() = initializers.firstIsInstanceOrNull<KtCallElement>() ?.getValueArgumentsInParentheses() ?.map { it.getArgumentExpression()?.toDefaultValueExpression() ?: ComplexExpression("") } diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 946d6416..e2aca6f9 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -269,7 +269,7 @@ open class DefaultPageCreator( it.sourceSets.toSet(), kind = ContentKind.SourceSetDependentHint, styles = emptySet(), - extra = PropertyContainer.empty<ContentNode>() + extra = PropertyContainer.empty() ) { +buildSignature(it) contentForBrief(it) @@ -293,7 +293,7 @@ open class DefaultPageCreator( it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependentHint, - extra = PropertyContainer.empty<ContentNode>() + extra = PropertyContainer.empty() ) { +buildSignature(it) contentForBrief(it) @@ -722,7 +722,7 @@ open class DefaultPageCreator( }.groupBy { it.second::class } private val Documentable.descriptions: SourceSetDependent<Description> - get() = groupedTags.withTypeUnnamed<Description>() + get() = groupedTags.withTypeUnnamed() private val Documentable.customTags: Map<String, SourceSetDependent<CustomTagWrapper>> get() = groupedTags.withTypeNamed() diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 88c51b02..7acf735a 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -540,7 +540,7 @@ class DefaultPsiToDocumentableTranslator( } private fun PsiClass.splitFunctionsAndAccessors(): Pair<MutableList<PsiMethod>, MutableMap<PsiField, MutableList<PsiMethod>>> { - val fieldNames = fields.map { it.name to it }.toMap() + val fieldNames = fields.associateBy { it.name } val accessors = mutableMapOf<PsiField, MutableList<PsiMethod>>() val regularMethods = mutableListOf<PsiMethod>() methods.forEach { method -> @@ -572,7 +572,7 @@ class DefaultPsiToDocumentableTranslator( emptyList(), false, psi.additionalExtras().let { - PropertyContainer.withAll<DProperty>( + PropertyContainer.withAll( it.toSourceSetDependent().toAdditionalModifiers(), (psi.annotations.toList() .toListOfAnnotations() + it.toListOfAnnotations()).toSourceSetDependent() diff --git a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt index f93f7d6d..a228e95a 100644 --- a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt +++ b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt @@ -85,7 +85,7 @@ class JavadocParser( parseWithChildren = parseWithChildren ) - private fun parseDocTag(tag: PsiDocTag, docComment: PsiDocComment, analysedElement: PsiNamedElement): TagWrapper? = + private fun parseDocTag(tag: PsiDocTag, docComment: PsiDocComment, analysedElement: PsiNamedElement): TagWrapper = enumValueOrNull<JavadocTag>(tag.name)?.let { javadocTag -> val resolutionContext = CommentResolutionContext(comment = docComment, tag = javadocTag) when (resolutionContext.tag) { diff --git a/plugins/base/src/main/kotlin/translators/psi/parsers/exceptionTag.kt b/plugins/base/src/main/kotlin/translators/psi/parsers/exceptionTag.kt index 6e1850bb..3cc16251 100644 --- a/plugins/base/src/main/kotlin/translators/psi/parsers/exceptionTag.kt +++ b/plugins/base/src/main/kotlin/translators/psi/parsers/exceptionTag.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka.base.translators.psi.parsers import com.intellij.psi.PsiElement import com.intellij.psi.PsiJavaCodeReferenceElement import com.intellij.psi.impl.source.tree.JavaDocElementType -import com.intellij.psi.javadoc.PsiDocTag import com.intellij.psi.util.PsiTreeUtil internal fun PsiElement.referenceElementOrSelf(): PsiElement? = |