From 0be397336e89782cda94c8bf55005a2be9abecde Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 4 Aug 2023 17:51:28 +0200 Subject: Reintroduce removed analysis APIs with a deprecation message (#3104) --- .../main/kotlin/deprecated/ParsersDeprecatedAPI.kt | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 plugins/base/src/main/kotlin/deprecated/ParsersDeprecatedAPI.kt (limited to 'plugins/base/src/main/kotlin/deprecated/ParsersDeprecatedAPI.kt') diff --git a/plugins/base/src/main/kotlin/deprecated/ParsersDeprecatedAPI.kt b/plugins/base/src/main/kotlin/deprecated/ParsersDeprecatedAPI.kt new file mode 100644 index 00000000..424c9492 --- /dev/null +++ b/plugins/base/src/main/kotlin/deprecated/ParsersDeprecatedAPI.kt @@ -0,0 +1,38 @@ +@file:Suppress("PackageDirectoryMismatch", "DEPRECATION_ERROR", "DeprecatedCallableAddReplaceWith", "unused") + +package org.jetbrains.dokka.base.parsers + +import org.jetbrains.dokka.base.deprecated.ANALYSIS_API_DEPRECATION_MESSAGE +import org.jetbrains.dokka.base.deprecated.AnalysisApiDeprecatedError +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.doc.DocTag +import org.jetbrains.dokka.model.doc.DocumentationNode +import org.jetbrains.dokka.model.doc.TagWrapper + +@Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) +abstract class Parser { + @Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) + open fun parseStringToDocNode(extractedString: String): DocTag = throw AnalysisApiDeprecatedError() + + @Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) + open fun preparse(text: String): String = throw AnalysisApiDeprecatedError() + + @Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) + open fun parseTagWithBody(tagName: String, content: String): TagWrapper = throw AnalysisApiDeprecatedError() +} + +@Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) +open class MarkdownParser( + private val externalDri: (String) -> DRI?, + private val kdocLocation: String?, +) : Parser() { + companion object { + @Deprecated(message = ANALYSIS_API_DEPRECATION_MESSAGE, level = DeprecationLevel.ERROR) + fun parseFromKDocTag( + @Suppress("UNUSED_PARAMETER") kDocTag: Any?, + @Suppress("UNUSED_PARAMETER") externalDri: (String) -> DRI?, + @Suppress("UNUSED_PARAMETER") kdocLocation: String?, + @Suppress("UNUSED_PARAMETER") parseWithChildren: Boolean = true + ): DocumentationNode = throw AnalysisApiDeprecatedError() + } +} -- cgit