diff options
Diffstat (limited to 'core/src/main/kotlin')
8 files changed, 114 insertions, 114 deletions
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index 1a0822d7..a3f72220 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -5,7 +5,7 @@ import com.intellij.psi.PsiJavaFile import com.intellij.psi.PsiManager import org.jetbrains.dokka.analysis.AnalysisEnvironment import org.jetbrains.dokka.analysis.DokkaResolutionFacade -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext @@ -76,17 +76,17 @@ class DokkaGenerator( platforms.map { (pdata, _) -> translatePsi(pdata, context) } fun mergeDocumentationModels( - modulesFromPlatforms: List<Module>, + modulesFromPlatforms: List<DModule>, context: DokkaContext ) = context.single(CoreExtensions.documentableMerger).invoke(modulesFromPlatforms, context) fun transformDocumentationModel( - documentationModel: Module, + documentationModel: DModule, context: DokkaContext ) = context[CoreExtensions.documentableTransformer].fold(documentationModel) { acc, t -> t(acc, context) } fun createPages( - transformedDocumentation: Module, + transformedDocumentation: DModule, context: DokkaContext ) = context.single(CoreExtensions.documentableToPageTranslator).invoke(transformedDocumentation) @@ -119,7 +119,7 @@ class DokkaGenerator( EnvironmentAndFacade(environment, facade) } - private fun translateDescriptors(platformData: PlatformData, context: DokkaContext): Module { + private fun translateDescriptors(platformData: PlatformData, context: DokkaContext): DModule { val (environment, facade) = context.platforms.getValue(platformData) val packageFragments = environment.getSourceFiles().asSequence() @@ -132,7 +132,7 @@ class DokkaGenerator( .invoke(platformData.name, packageFragments, platformData) } - private fun translatePsi(platformData: PlatformData, context: DokkaContext): Module { + private fun translatePsi(platformData: PlatformData, context: DokkaContext): DModule { val (environment, _) = context.platforms.getValue(platformData) val sourceRoots = environment.configuration.get(CLIConfigurationKeys.CONTENT_ROOTS) diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index b697f4e4..22930bf2 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -48,9 +48,9 @@ interface WithExpectActual { } interface WithScope { - val functions: List<Function> - val properties: List<Property> - val classlikes: List<Classlike> + val functions: List<DFunction> + val properties: List<DProperty> + val classlikes: List<DClasslike> } interface WithVisibility { @@ -81,15 +81,15 @@ sealed class JavaModifier(name: String) : Modifier(name) { } interface WithCompanion { - val companion: Object? + val companion: DObject? } interface WithConstructors { - val constructors: List<Function> + val constructors: List<DFunction> } interface WithGenerics { - val generics: List<TypeParameter> + val generics: List<DTypeParameter> } interface WithSupertypes { @@ -97,232 +97,232 @@ interface WithSupertypes { } interface Callable : WithVisibility, WithType, WithAbstraction, WithExpectActual { - val receiver: Parameter? + val receiver: DParameter? } -abstract class Classlike : Documentable(), WithScope, WithVisibility, WithExpectActual +abstract class DClasslike : Documentable(), WithScope, WithVisibility, WithExpectActual -data class Module( +data class DModule( override val name: String, - val packages: List<Package>, + val packages: List<DPackage>, override val documentation: PlatformDependent<DocumentationNode>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Module> = PropertyContainer.empty() -) : Documentable(), WithExtraProperties<Module> { + override val extra: PropertyContainer<DModule> = PropertyContainer.empty() +) : Documentable(), WithExtraProperties<DModule> { override val dri: DRI = DRI.topLevel override val children: List<Documentable> get() = packages - override fun withNewExtras(newExtras: PropertyContainer<Module>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DModule>) = copy(extra = newExtras) } -data class Package( +data class DPackage( override val dri: DRI, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val documentation: PlatformDependent<DocumentationNode>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Package> = PropertyContainer.empty() -) : Documentable(), WithScope, WithExtraProperties<Package> { + override val extra: PropertyContainer<DPackage> = PropertyContainer.empty() +) : Documentable(), WithScope, WithExtraProperties<DPackage> { override val name = dri.packageName.orEmpty() override val children: List<Documentable> get() = (properties + functions + classlikes) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Package>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DPackage>) = copy(extra = newExtras) } -data class Class( +data class DClass( override val dri: DRI, override val name: String, - override val constructors: List<Function>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val constructors: List<DFunction>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val sources: PlatformDependent<DocumentableSource>, override val visibility: PlatformDependent<Visibility>, - override val companion: Object?, - override val generics: List<TypeParameter>, + override val companion: DObject?, + override val generics: List<DTypeParameter>, override val supertypes: PlatformDependent<List<DRI>>, override val documentation: PlatformDependent<DocumentationNode>, override val modifier: Modifier, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Class> = PropertyContainer.empty() -) : Classlike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, - WithExtraProperties<Class> { + override val extra: PropertyContainer<DClass> = PropertyContainer.empty() +) : DClasslike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, + WithExtraProperties<DClass> { override val children: List<Documentable> get() = (functions + properties + classlikes + constructors) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Class>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DClass>) = copy(extra = newExtras) } -data class Enum( +data class DEnum( override val dri: DRI, override val name: String, - val entries: List<EnumEntry>, + val entries: List<DEnumEntry>, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val visibility: PlatformDependent<Visibility>, - override val companion: Object?, - override val constructors: List<Function>, + override val companion: DObject?, + override val constructors: List<DFunction>, override val supertypes: PlatformDependent<List<DRI>>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Enum> = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<Enum> { + override val extra: PropertyContainer<DEnum> = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<DEnum> { override val children: List<Documentable> get() = (entries + functions + properties + classlikes + constructors) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Enum>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DEnum>) = copy(extra = newExtras) } -data class EnumEntry( +data class DEnumEntry( override val dri: DRI, override val name: String, override val documentation: PlatformDependent<DocumentationNode>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<EnumEntry> = PropertyContainer.empty() -) : Documentable(), WithScope, WithExtraProperties<EnumEntry> { + override val extra: PropertyContainer<DEnumEntry> = PropertyContainer.empty() +) : Documentable(), WithScope, WithExtraProperties<DEnumEntry> { override val children: List<Documentable> get() = (functions + properties + classlikes) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<EnumEntry>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DEnumEntry>) = copy(extra = newExtras) } -data class Function( +data class DFunction( override val dri: DRI, override val name: String, val isConstructor: Boolean, - val parameters: List<Parameter>, + val parameters: List<DParameter>, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, override val visibility: PlatformDependent<Visibility>, override val type: Bound, - override val generics: List<TypeParameter>, - override val receiver: Parameter?, + override val generics: List<DTypeParameter>, + override val receiver: DParameter?, override val modifier: Modifier, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Function> = PropertyContainer.empty() -) : Documentable(), Callable, WithGenerics, WithExtraProperties<Function> { + override val extra: PropertyContainer<DFunction> = PropertyContainer.empty() +) : Documentable(), Callable, WithGenerics, WithExtraProperties<DFunction> { override val children: List<Documentable> get() = parameters - override fun withNewExtras(newExtras: PropertyContainer<Function>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DFunction>) = copy(extra = newExtras) } -data class Interface( +data class DInterface( override val dri: DRI, override val name: String, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val visibility: PlatformDependent<Visibility>, - override val companion: Object?, - override val generics: List<TypeParameter>, + override val companion: DObject?, + override val generics: List<DTypeParameter>, override val supertypes: PlatformDependent<List<DRI>>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Interface> = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties<Interface> { + override val extra: PropertyContainer<DInterface> = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties<DInterface> { override val children: List<Documentable> get() = (functions + properties + classlikes) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Interface>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DInterface>) = copy(extra = newExtras) } -data class Object( +data class DObject( override val name: String?, override val dri: DRI, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val visibility: PlatformDependent<Visibility>, override val supertypes: PlatformDependent<List<DRI>>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Object> = PropertyContainer.empty() -) : Classlike(), WithSupertypes, WithExtraProperties<Object> { + override val extra: PropertyContainer<DObject> = PropertyContainer.empty() +) : DClasslike(), WithSupertypes, WithExtraProperties<DObject> { override val children: List<Documentable> get() = (functions + properties + classlikes) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Object>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DObject>) = copy(extra = newExtras) } -data class Annotation( +data class DAnnotation( override val name: String, override val dri: DRI, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, - override val functions: List<Function>, - override val properties: List<Property>, - override val classlikes: List<Classlike>, + override val functions: List<DFunction>, + override val properties: List<DProperty>, + override val classlikes: List<DClasslike>, override val visibility: PlatformDependent<Visibility>, - override val companion: Object?, - override val constructors: List<Function>, + override val companion: DObject?, + override val constructors: List<DFunction>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Annotation> = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithConstructors, WithExtraProperties<Annotation> { + override val extra: PropertyContainer<DAnnotation> = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithConstructors, WithExtraProperties<DAnnotation> { override val children: List<Documentable> get() = (functions + properties + classlikes + constructors) as List<Documentable> - override fun withNewExtras(newExtras: PropertyContainer<Annotation>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DAnnotation>) = copy(extra = newExtras) } -data class Property( +data class DProperty( override val dri: DRI, override val name: String, override val documentation: PlatformDependent<DocumentationNode>, override val sources: PlatformDependent<DocumentableSource>, override val visibility: PlatformDependent<Visibility>, override val type: Bound, - override val receiver: Parameter?, - val setter: Function?, - val getter: Function?, + override val receiver: DParameter?, + val setter: DFunction?, + val getter: DFunction?, override val modifier: Modifier, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Property> = PropertyContainer.empty() -) : Documentable(), Callable, WithExtraProperties<Property> { + override val extra: PropertyContainer<DProperty> = PropertyContainer.empty() +) : Documentable(), Callable, WithExtraProperties<DProperty> { override val children: List<Nothing> get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer<Property>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DProperty>) = copy(extra = newExtras) } // TODO: treat named Parameters and receivers differently -data class Parameter( +data class DParameter( override val dri: DRI, override val name: String?, override val documentation: PlatformDependent<DocumentationNode>, val type: Bound, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<Parameter> = PropertyContainer.empty() -) : Documentable(), WithExtraProperties<Parameter> { + override val extra: PropertyContainer<DParameter> = PropertyContainer.empty() +) : Documentable(), WithExtraProperties<DParameter> { override val children: List<Nothing> get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer<Parameter>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DParameter>) = copy(extra = newExtras) } -data class TypeParameter( +data class DTypeParameter( override val dri: DRI, override val name: String, override val documentation: PlatformDependent<DocumentationNode>, val bounds: List<Bound>, override val platformData: List<PlatformData>, - override val extra: PropertyContainer<TypeParameter> = PropertyContainer.empty() -) : Documentable(), WithExtraProperties<TypeParameter> { + override val extra: PropertyContainer<DTypeParameter> = PropertyContainer.empty() +) : Documentable(), WithExtraProperties<DTypeParameter> { override val children: List<Nothing> get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer<TypeParameter>) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer<DTypeParameter>) = copy(extra = newExtras) } sealed class Projection diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index 38a06451..67e5e88d 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -3,12 +3,12 @@ package org.jetbrains.dokka.model import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy -data class InheritedFunction(val isInherited: Boolean): ExtraProperty<Function> { - object InheritedFunctionKey: ExtraProperty.Key<Function, Boolean> { +data class InheritedFunction(val isInherited: Boolean): ExtraProperty<DFunction> { + object InheritedFunctionKey: ExtraProperty.Key<DFunction, Boolean> { override fun mergeStrategyFor(left: Boolean, right: Boolean) = MergeStrategy.Fail { throw IllegalArgumentException("Function inheritance should be consistent!") } } - override val key: ExtraProperty.Key<Function, Boolean> = + override val key: ExtraProperty.Key<DFunction, Boolean> = InheritedFunctionKey }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt index d72eeafd..ca66b90a 100644 --- a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt +++ b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentableTranslator.kt @@ -1,6 +1,6 @@ package org.jetbrains.dokka.transformers.descriptors -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor @@ -9,5 +9,5 @@ interface DescriptorToDocumentableTranslator { moduleName: String, packageFragments: Iterable<PackageFragmentDescriptor>, platformData: PlatformData - ): Module + ): DModule }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt b/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt index 5a17bc24..c8ae9c02 100644 --- a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt +++ b/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt @@ -1,8 +1,8 @@ package org.jetbrains.dokka.transformers.documentation -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext interface DocumentableMerger { - operator fun invoke(modules: Collection<Module>, context: DokkaContext): Module + operator fun invoke(modules: Collection<DModule>, context: DokkaContext): DModule }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt index e41e0c84..83456f01 100644 --- a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt +++ b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt @@ -1,8 +1,8 @@ package org.jetbrains.dokka.transformers.documentation -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.ModulePageNode interface DocumentableToPageTranslator { - operator fun invoke(module: Module): ModulePageNode + operator fun invoke(module: DModule): ModulePageNode }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt index 88a1514d..3eb4704e 100644 --- a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt +++ b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt @@ -1,8 +1,8 @@ package org.jetbrains.dokka.transformers.documentation -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext interface DocumentableTransformer { - operator fun invoke(original: Module, context: DokkaContext): Module + operator fun invoke(original: DModule, context: DokkaContext): DModule }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt index 1ea07ff3..6f5025bd 100644 --- a/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt +++ b/core/src/main/kotlin/transformers/psi/PsiToDocumentableTranslator.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.transformers.psi import com.intellij.psi.PsiJavaFile -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext @@ -11,5 +11,5 @@ interface PsiToDocumentableTranslator { psiFiles: List<PsiJavaFile>, platformData: PlatformData, context: DokkaContext - ): Module + ): DModule } |