aboutsummaryrefslogtreecommitdiff
path: root/subprojects/analysis-kotlin-descriptors/compiler/src/main
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-31 20:16:01 +0200
committerGitHub <noreply@github.com>2023-08-31 20:16:01 +0200
commit02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch)
tree66f6d6f089a93b863bf1144666491eca6729ad05 /subprojects/analysis-kotlin-descriptors/compiler/src/main
parent6a181a7a2b03ec263788d137610e86937a57d434 (diff)
downloaddokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip
Enable explicit API mode (#3139)
Diffstat (limited to 'subprojects/analysis-kotlin-descriptors/compiler/src/main')
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/AnalysisContextCreator.kt4
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt26
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerExtensionPointProvider.kt10
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/DescriptorFinder.kt4
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KDocFinder.kt8
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KLibService.kt6
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/MockApplicationHack.kt4
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt12
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt2
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinAnalysis.kt10
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt8
11 files changed, 54 insertions, 40 deletions
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/AnalysisContextCreator.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/AnalysisContextCreator.kt
index 13c7d30d..67476a50 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/AnalysisContextCreator.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/AnalysisContextCreator.kt
@@ -13,8 +13,8 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
@InternalDokkaApi
-interface AnalysisContextCreator {
- fun create(
+public interface AnalysisContextCreator {
+ public fun create(
project: MockProject,
moduleDescriptor: ModuleDescriptor,
moduleResolver: ResolverForModule,
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt
index ff9da869..c59a43b2 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt
@@ -20,26 +20,34 @@ import org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.translator.Defau
import org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.translator.DefaultExternalDocumentablesProvider
import org.jetbrains.dokka.renderers.PostAction
import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
+import org.jetbrains.dokka.analysis.kotlin.internal.SampleProviderFactory
import org.jetbrains.dokka.plugability.*
import org.jetbrains.kotlin.asJava.elements.KtLightAbstractAnnotation
@Suppress("unused")
@InternalDokkaApi
-class CompilerDescriptorAnalysisPlugin : DokkaPlugin() {
+public class CompilerDescriptorAnalysisPlugin : DokkaPlugin() {
- val kdocFinder by extensionPoint<KDocFinder>()
+ @InternalDokkaApi
+ public val kdocFinder: ExtensionPoint<KDocFinder> by extensionPoint()
- val descriptorFinder by extensionPoint<DescriptorFinder>()
+ @InternalDokkaApi
+ public val descriptorFinder: ExtensionPoint<DescriptorFinder> by extensionPoint()
- val klibService by extensionPoint<KLibService>()
+ @InternalDokkaApi
+ public val klibService: ExtensionPoint<KLibService> by extensionPoint()
- val compilerExtensionPointProvider by extensionPoint<CompilerExtensionPointProvider>()
+ @InternalDokkaApi
+ public val compilerExtensionPointProvider: ExtensionPoint<CompilerExtensionPointProvider> by extensionPoint()
- val mockApplicationHack by extensionPoint<MockApplicationHack>()
+ @InternalDokkaApi
+ public val mockApplicationHack: ExtensionPoint<MockApplicationHack> by extensionPoint()
- val analysisContextCreator by extensionPoint<AnalysisContextCreator>()
+ @InternalDokkaApi
+ public val analysisContextCreator: ExtensionPoint<AnalysisContextCreator> by extensionPoint()
- val kotlinAnalysis by extensionPoint<KotlinAnalysis>()
+ @InternalDokkaApi
+ public val kotlinAnalysis: ExtensionPoint<KotlinAnalysis> by extensionPoint()
internal val documentableAnalyzerImpl by extending {
plugin<InternalKotlinAnalysisPlugin>().documentableSourceLanguageParser providing { CompilerDocumentableSourceLanguageParser() }
@@ -72,7 +80,7 @@ class CompilerDescriptorAnalysisPlugin : DokkaPlugin() {
* So it should have a possibility to override this extension
*/
@InternalDokkaApi
- val kotlinSampleProviderFactory by extending {
+ public val kotlinSampleProviderFactory: Extension<SampleProviderFactory, *, *> by extending {
plugin<InternalKotlinAnalysisPlugin>().sampleProviderFactory providing ::KotlinSampleProviderFactory
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerExtensionPointProvider.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerExtensionPointProvider.kt
index dace8dc1..e42efe41 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerExtensionPointProvider.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerExtensionPointProvider.kt
@@ -8,11 +8,11 @@ import org.jetbrains.dokka.InternalDokkaApi
import org.jetbrains.kotlin.extensions.ApplicationExtensionDescriptor
@InternalDokkaApi
-interface CompilerExtensionPointProvider {
- fun get(): List<CompilerExtensionPoint>
+public interface CompilerExtensionPointProvider {
+ public fun get(): List<CompilerExtensionPoint>
- class CompilerExtensionPoint(
- val extensionDescriptor: ApplicationExtensionDescriptor<Any>,
- val extensions: List<Any>
+ public class CompilerExtensionPoint(
+ public val extensionDescriptor: ApplicationExtensionDescriptor<Any>,
+ public val extensions: List<Any>
)
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/DescriptorFinder.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/DescriptorFinder.kt
index f7224157..db06647d 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/DescriptorFinder.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/DescriptorFinder.kt
@@ -9,6 +9,6 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.psi.KtDeclaration
@InternalDokkaApi
-interface DescriptorFinder {
- fun KtDeclaration.findDescriptor(): DeclarationDescriptor?
+public interface DescriptorFinder {
+ public fun KtDeclaration.findDescriptor(): DeclarationDescriptor?
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KDocFinder.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KDocFinder.kt
index f2bcba90..e5367211 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KDocFinder.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KDocFinder.kt
@@ -14,10 +14,10 @@ import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
@InternalDokkaApi
-interface KDocFinder {
- fun KtElement.findKDoc(): KDocTag?
+public interface KDocFinder {
+ public fun KtElement.findKDoc(): KDocTag?
- fun DeclarationDescriptor.find(
+ public fun DeclarationDescriptor.find(
descriptorToPsi: (DeclarationDescriptorWithSource) -> PsiElement? = {
DescriptorToSourceUtils.descriptorToDeclaration(
it
@@ -25,7 +25,7 @@ interface KDocFinder {
}
): KDocTag?
- fun resolveKDocLink(
+ public fun resolveKDocLink(
fromDescriptor: DeclarationDescriptor,
qualifiedName: String,
sourceSet: DokkaConfiguration.DokkaSourceSet,
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KLibService.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KLibService.kt
index 1a84e779..fc173298 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KLibService.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/KLibService.kt
@@ -14,8 +14,8 @@ import org.jetbrains.kotlin.library.KotlinLibrary
import org.jetbrains.kotlin.storage.StorageManager
@InternalDokkaApi
-interface KLibService {
- fun KotlinLibrary.createPackageFragmentProvider(
+public interface KLibService {
+ public fun KotlinLibrary.createPackageFragmentProvider(
storageManager: StorageManager,
metadataModuleDescriptorFactory: KlibMetadataModuleDescriptorFactory,
languageVersionSettings: LanguageVersionSettings,
@@ -23,5 +23,5 @@ interface KLibService {
lookupTracker: LookupTracker
): PackageFragmentProvider?
- fun isAnalysisCompatible(kotlinLibrary: KotlinLibrary): Boolean
+ public fun isAnalysisCompatible(kotlinLibrary: KotlinLibrary): Boolean
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/MockApplicationHack.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/MockApplicationHack.kt
index befbce02..39ca666b 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/MockApplicationHack.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/MockApplicationHack.kt
@@ -8,6 +8,6 @@ import com.intellij.mock.MockApplication
import org.jetbrains.dokka.InternalDokkaApi
@InternalDokkaApi
-interface MockApplicationHack { // ¯\_(ツ)_/¯
- fun hack(mockApplication: MockApplication)
+public interface MockApplicationHack { // ¯\_(ツ)_/¯
+ public fun hack(mockApplication: MockApplication)
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt
index 50f40aa0..917a86e7 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisContext.kt
@@ -6,6 +6,7 @@ package org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.configuration
import com.intellij.openapi.project.Project
import org.jetbrains.dokka.DokkaConfiguration
+import org.jetbrains.dokka.InternalDokkaApi
import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.AnalysisContextCreator
import org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.CompilerDescriptorAnalysisPlugin
@@ -92,9 +93,10 @@ internal class DokkaMessageCollector(private val logger: DokkaLogger) : MessageC
override fun hasErrors() = seenErrors
}
-interface AnalysisContext : Closeable {
- val environment: KotlinCoreEnvironment
- val resolveSession: ResolveSession
- val moduleDescriptor: ModuleDescriptor
- val project: Project
+@InternalDokkaApi
+public interface AnalysisContext : Closeable {
+ public val environment: KotlinCoreEnvironment
+ public val resolveSession: ResolveSession
+ public val moduleDescriptor: ModuleDescriptor
+ public val project: Project
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
index e0fa157c..5a0fc396 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
@@ -90,7 +90,7 @@ internal const val JAR_SEPARATOR = "!/"
* $body: optional and can be used to configure environment without creating local variable
*/
@InternalDokkaApi
-class AnalysisEnvironment(
+public class AnalysisEnvironment(
private val messageCollector: MessageCollector,
internal val analysisPlatform: Platform,
private val mockApplicationHack: MockApplicationHack,
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinAnalysis.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinAnalysis.kt
index 1f7df3f0..4e6f42c9 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinAnalysis.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinAnalysis.kt
@@ -59,15 +59,15 @@ internal fun SamplesKotlinAnalysis(
return EnvironmentKotlinAnalysis(environments, projectKotlinAnalysis)
}
@DokkaPluginApiPreview
-data class DokkaAnalysisConfiguration(
+public data class DokkaAnalysisConfiguration(
/**
* Only for common platform ignore BuiltIns for StdLib since it can cause a conflict
* between BuiltIns from a compiler and ones from source code.
*/
val ignoreCommonBuiltIns: Boolean = DEFAULT_IGNORE_COMMON_BUILT_INS
): ConfigurableBlock {
- companion object {
- const val DEFAULT_IGNORE_COMMON_BUILT_INS = false
+ public companion object {
+ public const val DEFAULT_IGNORE_COMMON_BUILT_INS: Boolean = false
}
}
@@ -75,11 +75,11 @@ data class DokkaAnalysisConfiguration(
* First child delegation. It does not close [parent].
*/
@InternalDokkaApi
-abstract class KotlinAnalysis(
+public abstract class KotlinAnalysis(
private val parent: KotlinAnalysis? = null
) : Closeable {
- operator fun get(key: DokkaSourceSet): AnalysisContext {
+ public operator fun get(key: DokkaSourceSet): AnalysisContext {
return get(key.sourceSetID)
}
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt
index 38037c1d..5199abf5 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt
@@ -24,7 +24,9 @@ import org.jetbrains.kotlin.psi.KtDeclarationWithBody
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
-class KotlinSampleProviderFactory(val context: DokkaContext): SampleProviderFactory {
+public class KotlinSampleProviderFactory(
+ public val context: DokkaContext
+): SampleProviderFactory {
override fun build(): SampleProvider {
return KotlinSampleProvider(context)
}
@@ -35,7 +37,9 @@ class KotlinSampleProviderFactory(val context: DokkaContext): SampleProviderFact
* with [processBody] and [processImports]
*/
@InternalDokkaApi
-open class KotlinSampleProvider(val context: DokkaContext): SampleProvider {
+public open class KotlinSampleProvider(
+ public val context: DokkaContext
+): SampleProvider {
private val kDocFinder: KDocFinder = context.plugin<CompilerDescriptorAnalysisPlugin>().querySingle { kdocFinder }
private val analysis = lazy {
/**