Skip to content

Commit

Permalink
Stabilize ExternalDocumentableProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Oct 31, 2023
1 parent 0ab0acf commit dfd903b
Show file tree
Hide file tree
Showing 16 changed files with 364 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

package translators

import org.jetbrains.dokka.analysis.kotlin.internal.ExternalDocumentablesProvider
import org.jetbrains.dokka.analysis.kotlin.KotlinAnalysisPlugin
import org.jetbrains.dokka.analysis.kotlin.documentable.ExternalDocumentableProvider
import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.DClass
Expand Down Expand Up @@ -36,9 +37,9 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
""".trimIndent(),
configuration
) {
lateinit var provider: ExternalDocumentablesProvider
lateinit var provider: ExternalDocumentableProvider
pluginsSetupStage = {
provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
provider = it.plugin<KotlinAnalysisPlugin>().querySingle { externalDocumentableProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
Expand Down Expand Up @@ -85,9 +86,9 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
""".trimIndent(),
configuration
) {
lateinit var provider: ExternalDocumentablesProvider
lateinit var provider: ExternalDocumentableProvider
pluginsSetupStage = {
provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
provider = it.plugin<KotlinAnalysisPlugin>().querySingle { externalDocumentableProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
Expand Down Expand Up @@ -127,9 +128,9 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
""".trimIndent(),
configuration
) {
lateinit var provider: ExternalDocumentablesProvider
lateinit var provider: ExternalDocumentableProvider
pluginsSetupStage = {
provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
provider = it.plugin<KotlinAnalysisPlugin>().querySingle { externalDocumentableProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package org.jetbrains.dokka.analysis.kotlin

import org.jetbrains.dokka.analysis.kotlin.documentable.ExternalDocumentableProvider
import org.jetbrains.dokka.analysis.kotlin.sample.SampleAnalysisEnvironmentCreator
import org.jetbrains.dokka.analysis.kotlin.sample.SampleAnalysisEnvironment
import org.jetbrains.dokka.plugability.DokkaPlugin
Expand All @@ -20,6 +21,11 @@ public class KotlinAnalysisPlugin : DokkaPlugin() {
*/
public val sampleAnalysisEnvironmentCreator: ExtensionPoint<SampleAnalysisEnvironmentCreator> by extensionPoint()

/**
* TODO [external-documentable-provider] add documentation
*/
public val externalDocumentableProvider: ExtensionPoint<ExternalDocumentableProvider> by extensionPoint()

@OptIn(DokkaPluginApiPreview::class)
override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement = PluginApiPreviewAcknowledgement
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains.dokka.analysis.kotlin.documentable

import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.DClasslike

/**
* TODO [external-documentable-provider] add documentation
*/
public interface ExternalDocumentableProvider {

/**
* TODO [external-documentable-provider] add documentation
*/
public fun findClasslike(dri: DRI, sourceSet: DokkaSourceSet): DClasslike?
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class InternalKotlinAnalysisPlugin : DokkaPlugin() {

public val inheritanceBuilder: ExtensionPoint<InheritanceBuilder> by extensionPoint()

public val externalDocumentablesProvider: ExtensionPoint<ExternalDocumentablesProvider> by extensionPoint()

public val documentableSourceLanguageParser: ExtensionPoint<DocumentableSourceLanguageParser> by extensionPoint()

@OptIn(DokkaPluginApiPreview::class)
Expand Down
Loading

0 comments on commit dfd903b

Please sign in to comment.