From cacf1e0c6cda4e42fe6581946cad53a377c71ec7 Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Wed, 26 Feb 2020 11:52:03 +0100 Subject: Port some of the core tests from the previous model --- plugins/base/src/test/kotlin/model/JavaTest.kt | 367 +++++++++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 plugins/base/src/test/kotlin/model/JavaTest.kt (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt new file mode 100644 index 00000000..ea454763 --- /dev/null +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -0,0 +1,367 @@ +package model + +import org.jetbrains.dokka.model.* +import org.jetbrains.dokka.model.Enum +import org.jetbrains.dokka.model.Function +import org.junit.Assert.assertTrue +import org.junit.Test +import utils.AbstractModelTest +import utils.assertNotNull + +class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { + + @Test //todo params in comments + fun function() { + inlineModelTest( + """ + |class Test { + | /** + | * Summary for Function + | * @param name is String parameter + | * @param value is int parameter + | */ + | public void fn(String name, int value) {} + |} + """ + ) { + with((this / "java" / "Test").cast()) { + name equals "Test" + children counts 1 + with((this / "fn").cast()) { + name equals "fn" + this + } + } + } + } + + //@Test fun function() { + // verifyJavaPackageMember("testdata/java/member.java", defaultModelConfig) { cls -> + // assertEquals("Test", cls.name) + // assertEquals(NodeKind.Class, cls.kind) + // with(cls.members(NodeKind.Function).single()) { + // assertEquals("fn", name) + // assertEquals("Summary for Function", content.summary.toTestString().trimEnd()) + // assertEquals(3, content.sections.size) + // with(content.sections[0]) { + // assertEquals("Parameters", tag) + // assertEquals("name", subjectName) + // assertEquals("render(Type:String,SUMMARY): is String parameter", toTestString()) + // } + // with(content.sections[1]) { + // assertEquals("Parameters", tag) + // assertEquals("value", subjectName) + // assertEquals("render(Type:Int,SUMMARY): is int parameter", toTestString()) + // } + // assertEquals("Unit", detail(NodeKind.Type).name) + // assertTrue(members.none()) + // assertTrue(links.none()) + // with(details.first { it.name == "name" }) { + // assertEquals(NodeKind.Parameter, kind) + // assertEquals("String", detail(NodeKind.Type).name) + // } + // with(details.first { it.name == "value" }) { + // assertEquals(NodeKind.Parameter, kind) + // assertEquals("Int", detail(NodeKind.Type).name) + // } + // } + // } + // } + + @Test // todo + fun memberWithModifiers() { + inlineModelTest( + """ + |class Test { + | /** + | * Summary for Function + | * @param name is String parameter + | * @param value is int parameter + | */ + | public void fn(String name, int value) {} + |} + """ + ) { + with((this / "java" / "Test" / "fn").cast()) { + this + } + } + } + + // @Test fun memberWithModifiers() { + // verifyJavaPackageMember("testdata/java/memberWithModifiers.java", defaultModelConfig) { cls -> + // val modifiers = cls.details(NodeKind.Modifier).map { it.name } + // assertTrue("abstract" in modifiers) + // with(cls.members.single { it.name == "fn" }) { + // assertEquals("protected", details[0].name) + // } + // with(cls.members.single { it.name == "openFn" }) { + // assertEquals("open", details[1].name) + // } + // } + // } + + @Test + fun superClass() { + inlineModelTest( + """ + |public class Foo extends Exception implements Cloneable {} + """ + ) { + with((this / "java" / "Foo").cast()) { + val sups = listOf("Exception", "Cloneable") + assertTrue( + "Foo must extend ${sups.joinToString(", ")}", + sups.all { s -> supertypes.map.values.flatten().any { it.classNames == s } }) + } + } + } + + @Test + fun arrayType() { + inlineModelTest( + """ + |class Test { + | public String[] arrayToString(int[] data) { + | return null; + | } + |} + """ + ) { + with((this / "java" / "Test").cast()) { + name equals "Test" + children counts 1 + + with((this / "arrayToString").cast()) { + name equals "arrayToString" + type.constructorFqName equals "java.lang.String[]" + with(parameters.firstOrNull().assertNotNull("parameters")) { + name equals "data" + type.constructorFqName equals "int[]" + } + } + } + } + } + + @Test + fun typeParameter() { + inlineModelTest( + """ + |class Foo> { + | public E foo(); + |} + """ + ) { + with((this / "java" / "Foo").cast()) { + this + } + } + } + + // @Test fun typeParameter() { + // verifyJavaPackageMember("testdata/java/typeParameter.java", defaultModelConfig) { cls -> + // val typeParameters = cls.details(NodeKind.TypeParameter) + // with(typeParameters.single()) { + // assertEquals("T", name) + // with(detail(NodeKind.UpperBound)) { + // assertEquals("Comparable", name) + // assertEquals("T", detail(NodeKind.Type).name) + // } + // } + // with(cls.members(NodeKind.Function).single()) { + // val methodTypeParameters = details(NodeKind.TypeParameter) + // with(methodTypeParameters.single()) { + // assertEquals("E", name) + // } + // } + // } + // } + + @Test + fun constructors() { + inlineModelTest( + """ + |class Test { + | public Test() {} + | + | public Test(String s) {} + |} + """ + ) { + with((this / "java" / "Test").cast()) { + name equals "Test" + + constructors counts 2 + constructors.find { it.parameters.isNullOrEmpty() }.assertNotNull("Test()") + + with(constructors.find { it.parameters.isNotEmpty() }.assertNotNull("Test(String)")) { + parameters.firstOrNull()?.type?.constructorFqName equals "java.lang.String" + } + } + } + } + + @Test + fun innerClass() { + inlineModelTest( + """ + |class InnerClass { + | public class D {} + |} + """ + ) { + with((this / "java" / "InnerClass").cast()) { + children counts 1 + with((this / "D").cast()) { + name equals "D" + children counts 0 + } + } + } + } + + @Test + fun varargs() { + inlineModelTest( + """ + |class Foo { + | public void bar(String... x); + |} + """ + ) { + with((this / "java" / "Foo").cast()) { + name equals "Foo" + children counts 1 + + with((this / "bar").cast()) { + name equals "bar" + with(parameters.firstOrNull().assertNotNull("parameter")) { + name equals "x" + type.constructorFqName equals "java.lang.String..." + } + } + } + } + } + + @Test // todo + fun fields() { + inlineModelTest( + """ + |class Test { + | public int i; + | public static final String s; + |} + """ + ) { + with((this / "java" / "Test").cast()) { + children counts 2 + + with((this / "i").cast()) { + getter.assertNotNull("i.get") + setter.assertNotNull("i.set") + } + + with((this / "s").cast()) { + getter.assertNotNull("s.get") + setter.assertNotNull("s.set") + + } + } + } + } + + // @Test fun fields() { + // verifyJavaPackageMember("testdata/java/field.java", defaultModelConfig) { cls -> + // val i = cls.members(NodeKind.Property).single { it.name == "i" } + // assertEquals("Int", i.detail(NodeKind.Type).name) + // assertTrue("var" in i.details(NodeKind.Modifier).map { it.name }) + // + // val s = cls.members(NodeKind.Property).single { it.name == "s" } + // assertEquals("String", s.detail(NodeKind.Type).name) + // assertFalse("var" in s.details(NodeKind.Modifier).map { it.name }) + // assertTrue("static" in s.details(NodeKind.Modifier).map { it.name }) + // } + // } + + // @Test fun staticMethod() { todo + // verifyJavaPackageMember("testdata/java/staticMethod.java", defaultModelConfig) { cls -> + // val m = cls.members(NodeKind.Function).single { it.name == "foo" } + // assertTrue("static" in m.details(NodeKind.Modifier).map { it.name }) + // } + // } + // + // /** + // * `@suppress` not supported in Java! + // * + // * [Proposed tags](https://www.oracle.com/technetwork/java/javase/documentation/proposed-tags-142378.html) + // * Proposed tag `@exclude` for it, but not supported yet + // */ + // @Ignore("@suppress not supported in Java!") @Test fun suppressTag() { + // verifyJavaPackageMember("testdata/java/suppressTag.java", defaultModelConfig) { cls -> + // assertEquals(1, cls.members(NodeKind.Function).size) + // } + // } + // + // @Test fun annotatedAnnotation() { + // verifyJavaPackageMember("testdata/java/annotatedAnnotation.java", defaultModelConfig) { cls -> + // assertEquals(1, cls.annotations.size) + // with(cls.annotations[0]) { + // assertEquals(1, details.count()) + // with(details[0]) { + // assertEquals(NodeKind.Parameter, kind) + // assertEquals(1, details.count()) + // with(details[0]) { + // assertEquals(NodeKind.Value, kind) + // assertEquals("[AnnotationTarget.FIELD, AnnotationTarget.CLASS, AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]", name) + // } + // } + // } + // } + // } + // + // @Test fun deprecation() { + // verifyJavaPackageMember("testdata/java/deprecation.java", defaultModelConfig) { cls -> + // val fn = cls.members(NodeKind.Function).single() + // assertEquals("This should no longer be used", fn.deprecation!!.content.toTestString()) + // } + // } + // + // @Test fun javaLangObject() { + // verifyJavaPackageMember("testdata/java/javaLangObject.java", defaultModelConfig) { cls -> + // val fn = cls.members(NodeKind.Function).single() + // assertEquals("Any", fn.detail(NodeKind.Type).name) + // } + // } + + @Test + fun enumValues() { + inlineModelTest( + """ + |enum E { + | Foo + |} + """ + ) { + with((this / "java" / "E").cast()) { + name equals "E" + entries counts 1 + + with((this / "Foo").cast()) { + name equals "Foo" + } + } + } + } + + + // todo + // @Test fun inheritorLinks() { + // verifyJavaPackageMember("testdata/java/InheritorLinks.java", defaultModelConfig) { cls -> + // val fooClass = cls.members.single { it.name == "Foo" } + // val inheritors = fooClass.references(RefKind.Inheritor) + // assertEquals(1, inheritors.size) + // } + // } +} \ No newline at end of file -- cgit From 996feefe717ac623daabaadda71b5b9d2bbe1cf1 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Mon, 16 Mar 2020 14:33:38 +0100 Subject: Rename Documentables to avoid name conflicts --- core/src/main/kotlin/DokkaGenerator.kt | 12 +- core/src/main/kotlin/model/Documentable.kt | 190 ++++++++++----------- .../main/kotlin/model/documentableProperties.kt | 6 +- .../DescriptorToDocumentableTranslator.kt | 4 +- .../documentation/DocumentableMerger.kt | 4 +- .../documentation/DocumentableToPageTranslator.kt | 4 +- .../documentation/DocumentableTransformer.kt | 4 +- .../psi/PsiToDocumentableTranslator.kt | 4 +- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 4 +- .../kotlin/signatures/KotlinSignatureProvider.kt | 35 ++-- .../documentables/DefaultDocumentableMerger.kt | 116 ++++++------- .../DefaultDescriptorToDocumentableTranslator.kt | 78 +++++---- .../DefaultDocumentableToPageTranslator.kt | 4 +- .../documentables/DefaultPageCreator.kt | 18 +- .../psi/DefaultPsiToDocumentableTranslator.kt | 40 ++--- plugins/base/src/test/kotlin/enums/EnumsTest.kt | 5 +- plugins/base/src/test/kotlin/issues/IssuesTest.kt | 18 +- plugins/base/src/test/kotlin/markdown/KDocTest.kt | 4 +- plugins/base/src/test/kotlin/model/ClassesTest.kt | 60 +++---- plugins/base/src/test/kotlin/model/CommentTest.kt | 32 ++-- .../base/src/test/kotlin/model/FunctionsTest.kt | 18 +- plugins/base/src/test/kotlin/model/JavaTest.kt | 38 ++--- plugins/base/src/test/kotlin/model/PackagesTest.kt | 16 +- plugins/base/src/test/kotlin/model/PropertyTest.kt | 20 +-- plugins/base/src/test/kotlin/utils/ModelUtils.kt | 6 +- plugins/base/src/test/kotlin/utils/TestUtils.kt | 8 +- .../kotlin/converters/KotlinToJavaConverter.kt | 54 +++--- .../kotlin/signatures/JavaSignatureProvider.kt | 34 ++-- .../KotlinAsJavaDocumentableTransformer.kt | 4 +- .../main/kotlin/testApi/testRunner/TestRunner.kt | 14 +- 30 files changed, 422 insertions(+), 432 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') 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, + modulesFromPlatforms: List, 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 - val properties: List - val classlikes: List + val functions: List + val properties: List + val classlikes: List } 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 + val constructors: List } interface WithGenerics { - val generics: List + val generics: List } 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, + val packages: List, override val documentation: PlatformDependent, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), WithExtraProperties { override val dri: DRI = DRI.topLevel override val children: List get() = packages - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Package( +data class DPackage( override val dri: DRI, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val documentation: PlatformDependent, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), WithScope, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), WithScope, WithExtraProperties { override val name = dri.packageName.orEmpty() override val children: List get() = (properties + functions + classlikes) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Class( +data class DClass( override val dri: DRI, override val name: String, - override val constructors: List, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val constructors: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val sources: PlatformDependent, override val visibility: PlatformDependent, - override val companion: Object?, - override val generics: List, + override val companion: DObject?, + override val generics: List, override val supertypes: PlatformDependent>, override val documentation: PlatformDependent, override val modifier: Modifier, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Classlike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, - WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : DClasslike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, + WithExtraProperties { override val children: List get() = (functions + properties + classlikes + constructors) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Enum( +data class DEnum( override val dri: DRI, override val name: String, - val entries: List, + val entries: List, override val documentation: PlatformDependent, override val sources: PlatformDependent, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val visibility: PlatformDependent, - override val companion: Object?, - override val constructors: List, + override val companion: DObject?, + override val constructors: List, override val supertypes: PlatformDependent>, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties { override val children: List get() = (entries + functions + properties + classlikes + constructors) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class EnumEntry( +data class DEnumEntry( override val dri: DRI, override val name: String, override val documentation: PlatformDependent, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), WithScope, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), WithScope, WithExtraProperties { override val children: List get() = (functions + properties + classlikes) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Function( +data class DFunction( override val dri: DRI, override val name: String, val isConstructor: Boolean, - val parameters: List, + val parameters: List, override val documentation: PlatformDependent, override val sources: PlatformDependent, override val visibility: PlatformDependent, override val type: Bound, - override val generics: List, - override val receiver: Parameter?, + override val generics: List, + override val receiver: DParameter?, override val modifier: Modifier, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), Callable, WithGenerics, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), Callable, WithGenerics, WithExtraProperties { override val children: List get() = parameters - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Interface( +data class DInterface( override val dri: DRI, override val name: String, override val documentation: PlatformDependent, override val sources: PlatformDependent, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val visibility: PlatformDependent, - override val companion: Object?, - override val generics: List, + override val companion: DObject?, + override val generics: List, override val supertypes: PlatformDependent>, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties { override val children: List get() = (functions + properties + classlikes) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Object( +data class DObject( override val name: String?, override val dri: DRI, override val documentation: PlatformDependent, override val sources: PlatformDependent, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val visibility: PlatformDependent, override val supertypes: PlatformDependent>, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Classlike(), WithSupertypes, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : DClasslike(), WithSupertypes, WithExtraProperties { override val children: List get() = (functions + properties + classlikes) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Annotation( +data class DAnnotation( override val name: String, override val dri: DRI, override val documentation: PlatformDependent, override val sources: PlatformDependent, - override val functions: List, - override val properties: List, - override val classlikes: List, + override val functions: List, + override val properties: List, + override val classlikes: List, override val visibility: PlatformDependent, - override val companion: Object?, - override val constructors: List, + override val companion: DObject?, + override val constructors: List, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Classlike(), WithCompanion, WithConstructors, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : DClasslike(), WithCompanion, WithConstructors, WithExtraProperties { override val children: List get() = (functions + properties + classlikes + constructors) as List - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class Property( +data class DProperty( override val dri: DRI, override val name: String, override val documentation: PlatformDependent, override val sources: PlatformDependent, override val visibility: PlatformDependent, 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, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), Callable, WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), Callable, WithExtraProperties { override val children: List get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = 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, val type: Bound, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), WithExtraProperties { override val children: List get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) } -data class TypeParameter( +data class DTypeParameter( override val dri: DRI, override val name: String, override val documentation: PlatformDependent, val bounds: List, override val platformData: List, - override val extra: PropertyContainer = PropertyContainer.empty() -) : Documentable(), WithExtraProperties { + override val extra: PropertyContainer = PropertyContainer.empty() +) : Documentable(), WithExtraProperties { override val children: List get() = emptyList() - override fun withNewExtras(newExtras: PropertyContainer) = copy(extra = newExtras) + override fun withNewExtras(newExtras: PropertyContainer) = 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 { - object InheritedFunctionKey: ExtraProperty.Key { +data class InheritedFunction(val isInherited: Boolean): ExtraProperty { + object InheritedFunctionKey: ExtraProperty.Key { override fun mergeStrategyFor(left: Boolean, right: Boolean) = MergeStrategy.Fail { throw IllegalArgumentException("Function inheritance should be consistent!") } } - override val key: ExtraProperty.Key = + override val key: ExtraProperty.Key = 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, 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, context: DokkaContext): Module + operator fun invoke(modules: Collection, 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, platformData: PlatformData, context: DokkaContext - ): Module + ): DModule } diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index d7b2a912..34dac9f4 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -4,7 +4,7 @@ import kotlinx.html.* import kotlinx.html.stream.createHTML import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import java.io.File @@ -269,7 +269,7 @@ private fun PageNode.pageKind() = when (this) { is PackagePageNode -> "package" is ClasslikePageNode -> "class" is MemberPageNode -> when (this.documentable) { - is Function -> "function" + is DFunction -> "function" else -> "other" } else -> "other" diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index f600a3bf..8a080bb9 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -6,12 +6,11 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.DriOfUnit import org.jetbrains.dokka.links.sureClassNames import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Annotation -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DAnnotation +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentNode -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.TextStyle import org.jetbrains.dokka.utilities.DokkaLogger @@ -21,26 +20,26 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog private val ignoredVisibilities = setOf(JavaVisibility.Default, KotlinVisibility.Public) override fun signature(documentable: Documentable): ContentNode = when (documentable) { - is Function -> signature(documentable) - is Property -> signature(documentable) - is Classlike -> signature(documentable) - is TypeParameter -> signature(documentable) + is DFunction -> signature(documentable) + is DProperty -> signature(documentable) + is DClasslike -> signature(documentable) + is DTypeParameter -> signature(documentable) else -> throw NotImplementedError( "Cannot generate signature for ${documentable::class.qualifiedName} ${documentable.name}" ) } - private fun signature(c: Classlike) = contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(c: DClasslike) = contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace)) { platformText(c.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } - if (c is Class) { + if (c is DClass) { text(c.modifier.name + " ") } when (c) { - is Class -> text("class ") - is Interface -> text("interface ") - is Enum -> text("enum ") - is Object -> text("object ") - is Annotation -> text("annotation class ") + is DClass -> text("class ") + is DInterface -> text("interface ") + is DEnum -> text("enum ") + is DObject -> text("object ") + is DAnnotation -> text("annotation class ") } link(c.name!!, c.dri) if (c is WithSupertypes) { @@ -52,11 +51,11 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } } - private fun signature(p: Property) = contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(p: DProperty) = contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace)) { signatureForProjection(p.type) } - private fun signature(f: Function) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(f: DFunction) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) { platformText(f.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } text(f.modifier.name + " ") text("fun ") @@ -82,7 +81,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } } - private fun signature(t: TypeParameter) = contentBuilder.contentFor(t) { + private fun signature(t: DTypeParameter) = contentBuilder.contentFor(t) { link(t.name, t.dri) list(t.bounds, prefix = " : ") { signatureForProjection(it) diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index 4d47401b..bb7dbaaf 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -1,10 +1,10 @@ package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function -import org.jetbrains.dokka.model.Package -import org.jetbrains.dokka.model.Annotation +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction +import org.jetbrains.dokka.model.DPackage +import org.jetbrains.dokka.model.DAnnotation import org.jetbrains.dokka.model.properties.mergeExtras import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext @@ -12,7 +12,7 @@ import org.jetbrains.dokka.transformers.documentation.DocumentableMerger import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult internal object DefaultDocumentableMerger : DocumentableMerger { - override fun invoke(modules: Collection, context: DokkaContext): Module { + override fun invoke(modules: Collection, context: DokkaContext): DModule { val name = modules.map { it.name }.distinct().singleOrNull() ?: run { context.logger.error("All module names need to be the same") modules.first().name @@ -21,11 +21,11 @@ internal object DefaultDocumentableMerger : DocumentableMerger { return modules.reduce { left, right -> val list = listOf(left, right) - Module( + DModule( name = name, packages = merge( list.flatMap { it.packages }, - Package::mergeWith + DPackage::mergeWith ), documentation = list.platformDependentFor { documentation }, platformData = list.flatMap { it.platformData }.distinct() @@ -106,25 +106,25 @@ private sealed class Expect { } } -fun Package.mergeWith(other: Package): Package = copy( - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), +fun DPackage.mergeWith(other: DPackage): DPackage = copy( + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), documentation = documentation.mergeWith(other.documentation), platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Function.mergeWith(other: Function): Function = copy( - parameters = merge(this.parameters + other.parameters, Parameter::mergeWith), +fun DFunction.mergeWith(other: DFunction): DFunction = copy( + parameters = merge(this.parameters + other.parameters, DParameter::mergeWith), receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver, documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), visibility = visibility.mergeWith(other.visibility), platformData = (platformData + other.platformData).distinct(), - generics = merge(generics + other.generics, TypeParameter::mergeWith) + generics = merge(generics + other.generics, DTypeParameter::mergeWith) ).mergeExtras(this, other) -fun Property.mergeWith(other: Property): Property = copy( +fun DProperty.mergeWith(other: DProperty): DProperty = copy( receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver, documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), @@ -134,33 +134,33 @@ fun Property.mergeWith(other: Property): Property = copy( setter = setter?.let { s -> other.setter?.let { s.mergeWith(it) } ?: s } ?: other.setter ).mergeExtras(this, other) -fun Classlike.setPlatformData(platformData: List): Classlike = when (this) { - is Class -> copy(platformData = platformData) - is Enum -> copy(platformData = platformData) - is Interface -> copy(platformData = platformData) - is Object -> copy(platformData = platformData) +fun DClasslike.setPlatformData(platformData: List): DClasslike = when (this) { + is DClass -> copy(platformData = platformData) + is DEnum -> copy(platformData = platformData) + is DInterface -> copy(platformData = platformData) + is DObject -> copy(platformData = platformData) else -> throw IllegalStateException("${this::class.qualifiedName} ${this.name} cannot have platform set") } -fun Classlike.mergeWith(other: Classlike): Classlike = when { - this is Class && other is Class -> mergeWith(other) - this is Enum && other is Enum -> mergeWith(other) - this is Interface && other is Interface -> mergeWith(other) - this is Object && other is Object -> mergeWith(other) - this is Annotation && other is Annotation -> mergeWith(other) +fun DClasslike.mergeWith(other: DClasslike): DClasslike = when { + this is DClass && other is DClass -> mergeWith(other) + this is DEnum && other is DEnum -> mergeWith(other) + this is DInterface && other is DInterface -> mergeWith(other) + this is DObject && other is DObject -> mergeWith(other) + this is DAnnotation && other is DAnnotation -> mergeWith(other) else -> throw IllegalStateException("${this::class.qualifiedName} ${this.name} cannot be mergesd with ${other::class.qualifiedName} ${other.name}") } -fun Class.mergeWith(other: Class): Class = copy( +fun DClass.mergeWith(other: DClass): DClass = copy( constructors = mergeExpectActual( constructors + other.constructors, - Function::mergeWith + DFunction::mergeWith ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, - generics = merge(generics + other.generics, TypeParameter::mergeWith), + generics = merge(generics + other.generics, DTypeParameter::mergeWith), supertypes = supertypes.mergeWith(other.supertypes), documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), @@ -168,15 +168,15 @@ fun Class.mergeWith(other: Class): Class = copy( platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Enum.mergeWith(other: Enum): Enum = copy( - entries = merge(entries + other.entries, EnumEntry::mergeWith), +fun DEnum.mergeWith(other: DEnum): DEnum = copy( + entries = merge(entries + other.entries, DEnumEntry::mergeWith), constructors = mergeExpectActual( constructors + other.constructors, - Function::mergeWith + DFunction::mergeWith ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, supertypes = supertypes.mergeWith(other.supertypes), documentation = documentation.mergeWith(other.documentation), @@ -185,18 +185,18 @@ fun Enum.mergeWith(other: Enum): Enum = copy( platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun EnumEntry.mergeWith(other: EnumEntry): EnumEntry = copy( - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), +fun DEnumEntry.mergeWith(other: DEnumEntry): DEnumEntry = copy( + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), documentation = documentation.mergeWith(other.documentation), platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Object.mergeWith(other: Object): Object = copy( - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), +fun DObject.mergeWith(other: DObject): DObject = copy( + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), supertypes = supertypes.mergeWith(other.supertypes), documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), @@ -204,12 +204,12 @@ fun Object.mergeWith(other: Object): Object = copy( platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Interface.mergeWith(other: Interface): Interface = copy( - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), +fun DInterface.mergeWith(other: DInterface): DInterface = copy( + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, - generics = merge(generics + other.generics, TypeParameter::mergeWith), + generics = merge(generics + other.generics, DTypeParameter::mergeWith), supertypes = supertypes.mergeWith(other.supertypes), documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), @@ -217,14 +217,14 @@ fun Interface.mergeWith(other: Interface): Interface = copy( platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Annotation.mergeWith(other: Annotation): Annotation = copy( +fun DAnnotation.mergeWith(other: DAnnotation): DAnnotation = copy( constructors = mergeExpectActual( constructors + other.constructors, - Function::mergeWith + DFunction::mergeWith ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, Function::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, Property::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, Classlike::mergeWith, Classlike::setPlatformData), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, documentation = documentation.mergeWith(other.documentation), sources = sources.mergeWith(other.sources), @@ -232,12 +232,12 @@ fun Annotation.mergeWith(other: Annotation): Annotation = copy( platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun Parameter.mergeWith(other: Parameter): Parameter = copy( +fun DParameter.mergeWith(other: DParameter): DParameter = copy( documentation = documentation.mergeWith(other.documentation), platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) -fun TypeParameter.mergeWith(other: TypeParameter): TypeParameter = copy( +fun DTypeParameter.mergeWith(other: DTypeParameter): DTypeParameter = copy( documentation = documentation.mergeWith(other.documentation), platformData = (platformData + other.platformData).distinct() ).mergeExtras(this, other) \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 9a71145f..eb23ffd7 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -5,8 +5,8 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.PlatformData @@ -21,7 +21,6 @@ import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBo import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.calls.components.isVararg import org.jetbrains.kotlin.resolve.calls.tasks.isDynamic -import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.resolve.descriptorUtil.getAllSuperclassesWithoutAny import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces @@ -30,7 +29,6 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeProjection import org.jetbrains.dokka.model.Variance -import org.jetbrains.kotlin.library.metadata.KlibMetadataProtoBuf.fqName import org.jetbrains.kotlin.idea.kdoc.findKDoc class DefaultDescriptorToDocumentableTranslator( @@ -47,7 +45,7 @@ class DefaultDescriptorToDocumentableTranslator( DRIWithPlatformInfo(DRI.topLevel, PlatformDependent.empty()) ) } - }.let { Module(moduleName, it, PlatformDependent.empty(), listOf(platformData)) } + }.let { DModule(moduleName, it, PlatformDependent.empty(), listOf(platformData)) } } @@ -69,11 +67,11 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv override fun visitPackageFragmentDescriptor( descriptor: PackageFragmentDescriptor, parent: DRIWithPlatformInfo - ): Package { + ): DPackage { val driWithPlatform = DRI(packageName = descriptor.fqName.asString()).withEmptyInfo() val scope = descriptor.getMemberScope() - return Package( + return DPackage( dri = driWithPlatform.dri, functions = scope.functions(driWithPlatform), properties = scope.properties(driWithPlatform), @@ -83,7 +81,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - override fun visitClassDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Classlike = + override fun visitClassDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DClasslike = when (descriptor.kind) { ClassKind.ENUM_CLASS -> enumDescriptor(descriptor, parent) ClassKind.OBJECT -> objectDescriptor(descriptor, parent) @@ -91,12 +89,12 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv else -> classDescriptor(descriptor, parent) } - private fun interfaceDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Interface { + private fun interfaceDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DInterface { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val info = descriptor.resolveClassDescriptionData(platformData) - return Interface( + return DInterface( dri = driWithPlatform.dri, name = descriptor.name.asString(), functions = scope.functions(driWithPlatform), @@ -113,12 +111,12 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - private fun objectDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Object { + private fun objectDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DObject { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val info = descriptor.resolveClassDescriptionData(platformData) - return Object( + return DObject( dri = driWithPlatform.dri, name = descriptor.name.asString(), functions = scope.functions(driWithPlatform), @@ -133,12 +131,12 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - private fun enumDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Enum { + private fun enumDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DEnum { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val info = descriptor.resolveClassDescriptionData(platformData) - return Enum( + return DEnum( dri = driWithPlatform.dri, name = descriptor.name.asString(), entries = scope.enumEntries(driWithPlatform), @@ -156,11 +154,11 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - private fun enumEntryDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): EnumEntry { + private fun enumEntryDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DEnumEntry { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope - return EnumEntry( + return DEnumEntry( dri = driWithPlatform.dri, name = descriptor.name.asString(), documentation = descriptor.resolveDescriptorData(platformData), @@ -172,13 +170,13 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - private fun classDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): Class { + private fun classDescriptor(descriptor: ClassDescriptor, parent: DRIWithPlatformInfo): DClass { val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val info = descriptor.resolveClassDescriptionData(platformData) val actual = descriptor.createSources() - return Class( + return DClass( dri = driWithPlatform.dri, name = descriptor.name.asString(), constructors = descriptor.constructors.map { @@ -203,11 +201,11 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, parent: DRIWithPlatformInfo): Property { + override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, parent: DRIWithPlatformInfo): DProperty { val dri = parent.dri.copy(callable = Callable.from(descriptor)) val actual = descriptor.createSources() - return Property( + return DProperty( dri = dri, name = descriptor.name.asString(), receiver = descriptor.extensionReceiverParameter?.let { @@ -229,11 +227,11 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, parent: DRIWithPlatformInfo): Function { + override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, parent: DRIWithPlatformInfo): DFunction { val dri = parent.dri.copy(callable = Callable.from(descriptor)) val actual = descriptor.createSources() - return Function( + return DFunction( dri = dri, name = descriptor.name.asString(), isConstructor = false, @@ -254,10 +252,10 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ) } - override fun visitConstructorDescriptor(descriptor: ConstructorDescriptor, parent: DRIWithPlatformInfo): Function { + override fun visitConstructorDescriptor(descriptor: ConstructorDescriptor, parent: DRIWithPlatformInfo): DFunction { val dri = parent.dri.copy(callable = Callable.from(descriptor)) val actual = descriptor.createSources() - return Function( + return DFunction( dri = dri, name = "", isConstructor = true, @@ -281,7 +279,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv override fun visitReceiverParameterDescriptor( descriptor: ReceiverParameterDescriptor, parent: DRIWithPlatformInfo - ) = Parameter( + ) = DParameter( dri = parent.dri.copy(target = 0), name = null, type = descriptor.type.toBound(), @@ -293,12 +291,12 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv descriptor: PropertyAccessorDescriptor, propertyDescriptor: PropertyDescriptor, parent: DRI - ): Function { + ): DFunction { val dri = parent.copy(callable = Callable.from(descriptor)) val isGetter = descriptor is PropertyGetterDescriptor fun PropertyDescriptor.asParameter(parent: DRI) = - Parameter( + DParameter( parent.copy(target = 1), this.name.asString(), type = this.type.toBound(), @@ -320,7 +318,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv listOf(propertyDescriptor.asParameter(dri)) } - return Function( + return DFunction( dri, name, isConstructor = false, @@ -343,7 +341,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv } private fun parameter(index: Int, descriptor: ValueParameterDescriptor, parent: DRIWithPlatformInfo) = - Parameter( + DParameter( dri = parent.dri.copy(target = index + 1), name = descriptor.name.asString(), type = descriptor.type.toBound(), @@ -352,28 +350,28 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv extra = descriptor.additionalExtras() ) - private fun MemberScope.functions(parent: DRIWithPlatformInfo): List = + private fun MemberScope.functions(parent: DRIWithPlatformInfo): List = getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) { true } .filterIsInstance() .map { visitFunctionDescriptor(it, parent) } - private fun MemberScope.properties(parent: DRIWithPlatformInfo): List = + private fun MemberScope.properties(parent: DRIWithPlatformInfo): List = getContributedDescriptors(DescriptorKindFilter.VALUES) { true } .filterIsInstance() .map { visitPropertyDescriptor(it, parent) } - private fun MemberScope.classlikes(parent: DRIWithPlatformInfo): List = + private fun MemberScope.classlikes(parent: DRIWithPlatformInfo): List = getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS) { true } .filterIsInstance() .map { visitClassDescriptor(it, parent) } - .mapNotNull { it as? Classlike } + .mapNotNull { it as? DClasslike } - private fun MemberScope.packages(parent: DRIWithPlatformInfo): List = + private fun MemberScope.packages(parent: DRIWithPlatformInfo): List = getContributedDescriptors(DescriptorKindFilter.PACKAGES) { true } .filterIsInstance() .map { visitPackageFragmentDescriptor(it, parent) } - private fun MemberScope.enumEntries(parent: DRIWithPlatformInfo): List = + private fun MemberScope.enumEntries(parent: DRIWithPlatformInfo): List = this.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS) { true } .filterIsInstance() .filter { it.kind == ClassKind.ENUM_ENTRY } @@ -391,7 +389,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv } private fun TypeParameterDescriptor.toTypeParameter() = - TypeParameter( + DTypeParameter( DRI.from(this), name.identifier, PlatformDependent.from(platformData, getDocumentation()), @@ -428,7 +426,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv MarkdownParser(resolutionFacade, this).parseFromKDocTag(it) } - fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): Object? = companionObjectDescriptor?.let { + fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): DObject? = companionObjectDescriptor?.let { objectDescriptor(it, dri) } @@ -467,7 +465,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ExtraModifiers.OVERRIDE.takeIf { getSuperInterfaces().isNotEmpty() || getSuperClassNotAny() != null } ).toContainer() - fun ValueParameterDescriptor.additionalExtras(): PropertyContainer = + fun ValueParameterDescriptor.additionalExtras(): PropertyContainer = listOfNotNull( ExtraModifiers.DYNAMIC.takeIf { isDynamic() }, ExtraModifiers.NOINLINE.takeIf { isNoinline }, @@ -477,13 +475,13 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv ExtraModifiers.VARARG.takeIf { isVararg } ).toContainer() - fun TypeParameterDescriptor.additionalExtras(): PropertyContainer = + fun TypeParameterDescriptor.additionalExtras(): PropertyContainer = listOfNotNull( ExtraModifiers.DYNAMIC.takeIf { isDynamic() }, ExtraModifiers.REIFIED.takeIf { isReified } ).toContainer() - fun PropertyDescriptor.additionalExtras(): PropertyContainer = listOfNotNull( + fun PropertyDescriptor.additionalExtras(): PropertyContainer = listOfNotNull( ExtraModifiers.DYNAMIC.takeIf { isDynamic() }, ExtraModifiers.CONST.takeIf { isConst }, ExtraModifiers.LATEINIT.takeIf { isLateInit }, diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt index 16f9b9b3..04251947 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultDocumentableToPageTranslator.kt @@ -2,7 +2,7 @@ package org.jetbrains.dokka.base.translators.documentables import org.jetbrains.dokka.base.signatures.SignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.ModulePageNode import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator import org.jetbrains.dokka.utilities.DokkaLogger @@ -12,6 +12,6 @@ class DefaultDocumentableToPageTranslator( private val signatureProvider: SignatureProvider, private val logger: DokkaLogger ) : DocumentableToPageTranslator { - override fun invoke(module: Module): ModulePageNode = + override fun invoke(module: DModule): ModulePageNode = DefaultPageCreator(commentsToContentConverter, signatureProvider, logger).pageForModule(module) } \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 560bda71..a0b5a072 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -4,7 +4,7 @@ import org.jetbrains.dokka.base.signatures.SignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.doc.Property import org.jetbrains.dokka.model.doc.TagWrapper import org.jetbrains.dokka.pages.* @@ -17,16 +17,16 @@ open class DefaultPageCreator( ) { protected open val contentBuilder = PageContentBuilder(commentsToContentConverter, signatureProvider, logger) - open fun pageForModule(m: Module) = + open fun pageForModule(m: DModule) = ModulePageNode(m.name.ifEmpty { "" }, contentForModule(m), m, m.packages.map(::pageForPackage)) - open fun pageForPackage(p: Package): PackagePageNode = PackagePageNode( + open fun pageForPackage(p: DPackage): PackagePageNode = PackagePageNode( p.name, contentForPackage(p), setOf(p.dri), p, p.classlikes.map(::pageForClasslike) + p.functions.map(::pageForFunction) ) - open fun pageForClasslike(c: Classlike): ClasslikePageNode { + open fun pageForClasslike(c: DClasslike): ClasslikePageNode { val constructors = if (c is WithConstructors) c.constructors else emptyList() return ClasslikePageNode( @@ -37,9 +37,9 @@ open class DefaultPageCreator( ) } - open fun pageForFunction(f: Function) = MemberPageNode(f.name, contentForFunction(f), setOf(f.dri), f) + open fun pageForFunction(f: DFunction) = MemberPageNode(f.name, contentForFunction(f), setOf(f.dri), f) - protected open fun contentForModule(m: Module) = contentBuilder.contentFor(m) { + protected open fun contentForModule(m: DModule) = contentBuilder.contentFor(m) { header(1) { text(m.name) } block("Packages", 2, ContentKind.Packages, m.packages, m.platformData.toSet()) { link(it.name, it.dri) @@ -48,7 +48,7 @@ open class DefaultPageCreator( // text("Link to allpage here") } - protected open fun contentForPackage(p: Package) = contentBuilder.contentFor(p) { + protected open fun contentForPackage(p: DPackage) = contentBuilder.contentFor(p) { header(1) { text("Package ${p.name}") } +contentForScope(p, p.dri, p.platformData) } @@ -87,7 +87,7 @@ open class DefaultPageCreator( } } - protected open fun contentForClasslike(c: Classlike) = contentBuilder.contentFor(c) { + protected open fun contentForClasslike(c: DClasslike) = contentBuilder.contentFor(c) { header(1) { text(c.name.orEmpty()) } +buildSignature(c) @@ -126,7 +126,7 @@ open class DefaultPageCreator( } }.children - protected open fun contentForFunction(f: Function) = contentBuilder.contentFor(f) { + protected open fun contentForFunction(f: DFunction) = contentBuilder.contentFor(f) { header(1) { text(f.name) } +buildSignature(f) +contentForComments(f) diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 65f94843..c5c72a65 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -9,9 +9,9 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.JavaClassReference import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Annotation -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DAnnotation +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext @@ -31,17 +31,17 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { psiFiles: List, platformData: PlatformData, context: DokkaContext - ): Module { + ): DModule { val docParser = DokkaPsiParser( platformData, context.logger ) - return Module( + return DModule( moduleName, psiFiles.groupBy { it.packageName }.map { (packageName, psiFiles) -> val dri = DRI(packageName = packageName) - Package( + DPackage( dri, emptyList(), emptyList(), @@ -93,7 +93,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { private fun T.toPlatformDependant() = PlatformDependent(mapOf(platformData to this)) - fun parseClasslike(psi: PsiClass, parent: DRI): Classlike = with(psi) { + fun parseClasslike(psi: PsiClass, parent: DRI): DClasslike = with(psi) { val dri = parent.withClass(name.toString()) val ancestorsSet = hashSetOf() val superMethodsKeys = hashSetOf() @@ -133,7 +133,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { val ancestors = ancestorsSet.toList().toPlatformDependant() return when { isAnnotationType -> - Annotation( + DAnnotation( name.orEmpty(), dri, documentation, @@ -146,11 +146,11 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { constructors.map { parseFunction(it, dri, true) }, listOf(platformData) ) - isEnum -> Enum( + isEnum -> DEnum( dri, name.orEmpty(), fields.filterIsInstance().map { entry -> - EnumEntry( + DEnumEntry( dri.withClass("$name.${entry.name}"), entry.name.orEmpty(), javadocParser.parseDocumentation(entry).toPlatformDependant(), @@ -171,7 +171,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { ancestors, listOf(platformData) ) - isInterface -> Interface( + isInterface -> DInterface( dri, name.orEmpty(), documentation, @@ -185,7 +185,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { ancestors, listOf(platformData) ) - else -> Class( + else -> DClass( dri, name.orEmpty(), constructors.map { parseFunction(it, dri, true) }, @@ -209,7 +209,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { parent: DRI, isConstructor: Boolean = false, isInherited: Boolean = false - ): Function { + ): DFunction { val dri = parent.copy( callable = Callable( psi.name, @@ -218,12 +218,12 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { JavaClassReference(parameter.type.canonicalText) }) ) - return Function( + return DFunction( dri, if (isConstructor) "" else psi.name, isConstructor, psi.parameterList.parameters.mapIndexed { index, psiParameter -> - Parameter( + DParameter( dri.copy(target = index + 1), psiParameter.name, javadocParser.parseDocumentation(psiParameter).toPlatformDependant(), @@ -239,7 +239,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { null, psi.getModifier(), listOf(platformData), - PropertyContainer.empty() + InheritedFunction( + PropertyContainer.empty() + InheritedFunction( isInherited ) ) @@ -278,7 +278,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { else -> JavaModifier.Empty } - private fun PsiTypeParameterListOwner.mapTypeParameters(dri: DRI): List { + private fun PsiTypeParameterListOwner.mapTypeParameters(dri: DRI): List { fun mapBounds(bounds: Array): List = if (bounds.isEmpty()) emptyList() else bounds.mapNotNull { (it as? PsiClassType)?.let { classType -> @@ -286,7 +286,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { } } return typeParameters.mapIndexed { index, type -> - TypeParameter( + DTypeParameter( dri.copy(genericTarget = index), type.name.orEmpty(), javadocParser.parseDocumentation(type).toPlatformDependant(), @@ -323,7 +323,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { return regularMethods to accessors } - private fun parseField(psi: PsiField, parent: DRI, accessors: List): Property { + private fun parseField(psi: PsiField, parent: DRI, accessors: List): DProperty { val dri = parent.copy( callable = Callable( psi.name!!, // TODO: Investigate if this is indeed nullable @@ -331,7 +331,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { emptyList() ) ) - return Property( + return DProperty( dri, psi.name!!, // TODO: Investigate if this is indeed nullable javadocParser.parseDocumentation(psi).toPlatformDependant(), diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index ea3238a5..34e92d82 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -1,9 +1,8 @@ package enums -import org.jetbrains.dokka.model.Enum +import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.Assert import org.junit.Assert.* import org.junit.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest @@ -72,7 +71,7 @@ class EnumsTest : AbstractCoreTest() { p.first().classlikes.let { c -> assertTrue("Classlikes list cannot be empty", c.isNotEmpty()) - val enum = c.first() as Enum + val enum = c.first() as DEnum assertEquals(enum.name, "Test") assertEquals(enum.entries.count(), 2) assertNotNull(enum.companion) diff --git a/plugins/base/src/test/kotlin/issues/IssuesTest.kt b/plugins/base/src/test/kotlin/issues/IssuesTest.kt index ea2f0f8e..e34c610a 100644 --- a/plugins/base/src/test/kotlin/issues/IssuesTest.kt +++ b/plugins/base/src/test/kotlin/issues/IssuesTest.kt @@ -1,7 +1,7 @@ package issues -import org.jetbrains.dokka.model.Class -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DClass +import org.jetbrains.dokka.model.DFunction import org.junit.Test import utils.AbstractModelTest @@ -33,16 +33,16 @@ class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues" |} """ ) { - with((this / "issues" / "Test").cast()) { + with((this / "issues" / "Test").cast()) { // passes - (this / "working").cast().type.constructorFqName equals "kotlin.String" - (this / "doSomething").cast().type.constructorFqName equals "kotlin.String" + (this / "working").cast().type.constructorFqName equals "kotlin.String" + (this / "doSomething").cast().type.constructorFqName equals "kotlin.String" // fails - (this / "brokenGenerics").cast().type.constructorFqName equals "kotlin.collections.List" - (this / "brokenApply").cast().type.constructorFqName equals "issues.Test" - (this / "brokenRun").cast().type.constructorFqName equals "issues.Test" - (this / "brokenLet").cast().type.constructorFqName equals "issues.Test" + (this / "brokenGenerics").cast().type.constructorFqName equals "kotlin.collections.List" + (this / "brokenApply").cast().type.constructorFqName equals "issues.Test" + (this / "brokenRun").cast().type.constructorFqName equals "issues.Test" + (this / "brokenLet").cast().type.constructorFqName equals "issues.Test" } } } diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index e250670a..fa538c3e 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -1,6 +1,6 @@ package markdown -import org.jetbrains.dokka.model.Package +import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.pages.ModulePageNode import org.junit.Assert @@ -26,7 +26,7 @@ open class KDocTest : AbstractCoreTest() { """.trimMargin() private fun actualDocumentationNode(modulePageNode: ModulePageNode) = - (modulePageNode.documentable?.children?.first() as Package) + (modulePageNode.documentable?.children?.first() as DPackage) .classlikes.single() .documentation.values.single() diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index a59174bf..d627dab4 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -2,7 +2,7 @@ package model import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.KotlinModifier.* -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DFunction import org.junit.Test import utils.AbstractModelTest import utils.assertNotNull @@ -17,7 +17,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class """ |class Klass {}""" ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" children counts 4 } @@ -31,7 +31,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |object Obj {} """ ) { - with((this / "classes" / "Obj").cast()) { + with((this / "classes" / "Obj").cast()) { name equals "Obj" children counts 3 } @@ -45,7 +45,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |class Klass(name: String) """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" children counts 4 @@ -71,11 +71,11 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" children counts 5 - with((this / "fn").cast()) { + with((this / "fn").cast()) { type.constructorFqName equals "kotlin.Unit" parameters counts 0 visibility.values allEquals KotlinVisibility.Public @@ -93,11 +93,11 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" children counts 5 - with((this / "name").cast()) { + with((this / "name").cast()) { name equals "name" // TODO property name } @@ -117,19 +117,19 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" children counts 5 - with((this / "Companion").cast()) { + with((this / "Companion").cast()) { name equals "Companion" children counts 5 - with((this / "x").cast()) { + with((this / "x").cast()) { name equals "x" } - with((this / "foo").cast()) { + with((this / "foo").cast()) { name equals "foo" parameters counts 0 type.constructorFqName equals "kotlin.Unit" @@ -146,7 +146,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |data class Klass() {} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" visibility.values allEquals KotlinVisibility.Public with(extra[AdditionalModifiers.AdditionalKey].assertNotNull("Extras")) { @@ -170,7 +170,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |sealed class Klass() {} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" modifier equals KotlinModifier.Sealed } @@ -215,18 +215,18 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - val C = (this / "classes" / "C").cast() - val D = (this / "classes" / "D").cast() + val C = (this / "classes" / "C").cast() + val D = (this / "classes" / "D").cast() with(C) { modifier equals Open - with((this / "f").cast()) { + with((this / "f").cast()) { modifier equals Open } } with(D) { modifier equals Final - with((this / "f").cast()) { + with((this / "f").cast()) { modifier equals Open } D.supertypes.flatMap { it.component2() }.firstOrNull() equals C.dri @@ -249,13 +249,13 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - val C = (this / "classes" / "C").cast() - val D = (this / "classes" / "D").cast() - val E = (this / "classes" / "E").cast() + val C = (this / "classes" / "C").cast() + val D = (this / "classes" / "D").cast() + val E = (this / "classes" / "E").cast() with(C) { modifier equals Abstract - ((this / "foo").cast()).modifier equals Abstract + ((this / "foo").cast()).modifier equals Abstract } with(D) { @@ -280,9 +280,9 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "C").cast()) { + with((this / "classes" / "C").cast()) { - with((this / "D").cast()) { + with((this / "D").cast()) { } } } @@ -312,10 +312,10 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |val Klass.Default.x: Int get() = 1 """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" - with((this / "Default").cast()) { + with((this / "Default").cast()) { name equals "Default" // TODO extensions } @@ -342,7 +342,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "C").cast()) { + with((this / "classes" / "C").cast()) { name equals "C" constructors counts 2 @@ -384,14 +384,14 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class |} """ ) { - with((this / "classes" / "Klass").cast()) { + with((this / "classes" / "Klass").cast()) { name equals "Klass" - with((this / "Companion").cast()) { + with((this / "Companion").cast()) { name equals "Companion" visibility.values allEquals KotlinVisibility.Private - with((this / "fn").cast()) { + with((this / "fn").cast()) { name equals "fn" parameters counts 0 receiver equals null diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt index d576cf49..055892af 100644 --- a/plugins/base/src/test/kotlin/model/CommentTest.kt +++ b/plugins/base/src/test/kotlin/model/CommentTest.kt @@ -1,6 +1,6 @@ package model -import org.jetbrains.dokka.model.Property +import org.jetbrains.dokka.model.DProperty import org.jetbrains.dokka.model.doc.CustomWrapperTag import org.jetbrains.dokka.model.doc.Text import org.junit.Test @@ -28,7 +28,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val prop2 = "" """ ) { - with((this / "comment" / "prop1").cast()) { + with((this / "comment" / "prop1").cast()) { name equals "prop1" with(this.docs().firstOrNull()?.root.assertNotNull("Code")) { (children.firstOrNull() as? Text) @@ -37,7 +37,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme params["lang"] equals "brainfuck" } } - with((this / "comment" / "prop2").cast()) { + with((this / "comment" / "prop2").cast()) { name equals "prop2" comments() equals "a + b - c" } @@ -51,7 +51,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { name equals "property" comments() equals "" } @@ -68,7 +68,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme """ ) { val p = this - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "" } } @@ -87,7 +87,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "doc1\ndoc2 doc3" } } @@ -107,7 +107,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "doc1\ndoc2 doc3" } } @@ -121,7 +121,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "doc" } } @@ -136,7 +136,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "doc" } } @@ -151,7 +151,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "doc" } } @@ -168,7 +168,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "Summary\none: []" docs().find { it is CustomWrapperTag && it.name == "one" }.let { with(it.assertNotNull("'one' entry")) { @@ -188,7 +188,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals """it's "useful"""" } } @@ -205,7 +205,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "Summary\none: [section one]" } } @@ -224,7 +224,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "Summary\none: [section one]\ntwo: [section two]" } } @@ -243,7 +243,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |val property = "test" """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { comments() equals "Summary\none: [line one line two]" } } @@ -290,7 +290,7 @@ class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comme |} """ ) { - with((this / "comment" / "property").cast()) { + with((this / "comment" / "property").cast()) { this } } diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index 9554ad02..f3a7adc7 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -1,7 +1,7 @@ package model -import org.jetbrains.dokka.model.Function -import org.jetbrains.dokka.model.Package +import org.jetbrains.dokka.model.DFunction +import org.jetbrains.dokka.model.DPackage import org.junit.Test import utils.* @@ -17,7 +17,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |fun fn() {} """ ) { - with((this / "function" / "fn").cast()) { + with((this / "function" / "fn").cast()) { name equals "fn" type.constructorFqName equals "kotlin.Unit" this.children.assertCount(0, "Function children: ") @@ -39,7 +39,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |fun fn(i: Int) {} """ ) { - with((this / "function").cast()) { + with((this / "function").cast()) { val fn1 = functions.find { it.name == "fn" && it.parameters.isNullOrEmpty() }.assertNotNull("fn()") @@ -76,7 +76,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |fun String.fn(x: Int) {} """ ) { - with((this / "function").cast()) { + with((this / "function").cast()) { val fn1 = functions.find { it.name == "fn" && it.parameters.isNullOrEmpty() }.assertNotNull("fn()") @@ -114,7 +114,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |} """ ) { - with((this / "function" / "function").cast()) { + with((this / "function" / "function").cast()) { comments() equals "Multiline\nFunction Documentation" name equals "function" @@ -141,7 +141,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun ) { // TODO add annotations - with((this / "function" / "f").cast()) { + with((this / "function" / "f").cast()) { assert(false) { "No annotation data" } } } @@ -162,7 +162,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun ) { // TODO add data about inline - with((this / "function" / "f").cast()) { + with((this / "function" / "f").cast()) { assert(false) { "No inline data" } } } @@ -184,7 +184,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun ) { // TODO add data about suspend - with((this / "function" / "f").cast()) { + with((this / "function" / "f").cast()) { assert(false) { "No suspend data" } } } diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index ea454763..c2545e7a 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -1,8 +1,8 @@ package model import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.junit.Assert.assertTrue import org.junit.Test import utils.AbstractModelTest @@ -24,10 +24,10 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Test").cast()) { + with((this / "java" / "Test").cast()) { name equals "Test" children counts 1 - with((this / "fn").cast()) { + with((this / "fn").cast()) { name equals "fn" this } @@ -82,7 +82,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Test" / "fn").cast()) { + with((this / "java" / "Test" / "fn").cast()) { this } } @@ -108,7 +108,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |public class Foo extends Exception implements Cloneable {} """ ) { - with((this / "java" / "Foo").cast()) { + with((this / "java" / "Foo").cast()) { val sups = listOf("Exception", "Cloneable") assertTrue( "Foo must extend ${sups.joinToString(", ")}", @@ -128,11 +128,11 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Test").cast()) { + with((this / "java" / "Test").cast()) { name equals "Test" children counts 1 - with((this / "arrayToString").cast()) { + with((this / "arrayToString").cast()) { name equals "arrayToString" type.constructorFqName equals "java.lang.String[]" with(parameters.firstOrNull().assertNotNull("parameters")) { @@ -153,7 +153,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Foo").cast()) { + with((this / "java" / "Foo").cast()) { this } } @@ -189,7 +189,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Test").cast()) { + with((this / "java" / "Test").cast()) { name equals "Test" constructors counts 2 @@ -211,9 +211,9 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "InnerClass").cast()) { + with((this / "java" / "InnerClass").cast()) { children counts 1 - with((this / "D").cast()) { + with((this / "D").cast()) { name equals "D" children counts 0 } @@ -230,11 +230,11 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Foo").cast()) { + with((this / "java" / "Foo").cast()) { name equals "Foo" children counts 1 - with((this / "bar").cast()) { + with((this / "bar").cast()) { name equals "bar" with(parameters.firstOrNull().assertNotNull("parameter")) { name equals "x" @@ -255,15 +255,15 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "Test").cast()) { + with((this / "java" / "Test").cast()) { children counts 2 - with((this / "i").cast()) { + with((this / "i").cast()) { getter.assertNotNull("i.get") setter.assertNotNull("i.set") } - with((this / "s").cast()) { + with((this / "s").cast()) { getter.assertNotNull("s.get") setter.assertNotNull("s.set") @@ -344,11 +344,11 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |} """ ) { - with((this / "java" / "E").cast()) { + with((this / "java" / "E").cast()) { name equals "E" entries counts 1 - with((this / "Foo").cast()) { + with((this / "Foo").cast()) { name equals "Foo" } } diff --git a/plugins/base/src/test/kotlin/model/PackagesTest.kt b/plugins/base/src/test/kotlin/model/PackagesTest.kt index e19cc82d..008ae14d 100644 --- a/plugins/base/src/test/kotlin/model/PackagesTest.kt +++ b/plugins/base/src/test/kotlin/model/PackagesTest.kt @@ -1,6 +1,6 @@ package model -import org.jetbrains.dokka.model.Package +import org.jetbrains.dokka.model.DPackage import org.junit.Test import utils.AbstractModelTest @@ -14,7 +14,7 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac """.trimIndent(), prependPackage = false ) { - with((this / "").cast()) { + with((this / "").cast()) { name equals "" children counts 0 } @@ -29,7 +29,7 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac """.trimIndent(), prependPackage = false ) { - with((this / "simple").cast()) { + with((this / "simple").cast()) { name equals "simple" children counts 0 } @@ -44,7 +44,7 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac """.trimIndent(), prependPackage = false ) { - with((this / "dot.name").cast()) { + with((this / "dot.name").cast()) { name equals "dot.name" children counts 0 } @@ -63,11 +63,11 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac prependPackage = false ) { children counts 2 - with((this / "dot.name").cast()) { + with((this / "dot.name").cast()) { name equals "dot.name" children counts 0 } - with((this / "simple").cast()) { + with((this / "simple").cast()) { name equals "simple" children counts 0 } @@ -85,7 +85,7 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac prependPackage = false ) { children counts 1 - with((this / "simple").cast()) { + with((this / "simple").cast()) { name equals "simple" children counts 0 } @@ -102,7 +102,7 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac """.trimIndent(), prependPackage = false ) { - with((this / "simple.name").cast()) { + with((this / "simple.name").cast()) { name equals "simple.name" children counts 1 } diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index e4ef0aec..d12e292b 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -1,8 +1,8 @@ package model import org.jetbrains.dokka.model.KotlinVisibility -import org.jetbrains.dokka.model.Package -import org.jetbrains.dokka.model.Property +import org.jetbrains.dokka.model.DPackage +import org.jetbrains.dokka.model.DProperty import org.junit.Test import utils.AbstractModelTest import utils.assertNotNull @@ -15,7 +15,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro """ |val property = "test"""" ) { - with((this / "property" / "property").cast()) { + with((this / "property" / "property").cast()) { name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { @@ -33,7 +33,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro |var property = "test" """ ) { - with((this / "property" / "property").cast()) { + with((this / "property" / "property").cast()) { name equals "property" children counts 0 setter.assertNotNull("Setter") @@ -53,7 +53,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro | get() = "test" """ ) { - with((this / "property" / "property").cast()) { + with((this / "property" / "property").cast()) { name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { @@ -73,7 +73,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro | set(value) {} """ ) { - with((this / "property" / "property").cast()) { + with((this / "property" / "property").cast()) { name equals "property" children counts 0 setter.assertNotNull("Setter") @@ -93,7 +93,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro | get() = size() * 2 """ ) { - with((this / "property" / "property").cast()) { + with((this / "property" / "property").cast()) { name equals "property" children counts 0 with(receiver.assertNotNull("property receiver")) { @@ -120,15 +120,15 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro |} """ ) { - with((this / "property").cast()) { - with((this / "Foo" / "property").cast()) { + with((this / "property").cast()) { + with((this / "Foo" / "property").cast()) { name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { type.constructorFqName equals "kotlin.Int" } } - with((this / "Bar" / "property").cast()) { + with((this / "Bar" / "property").cast()) { name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { diff --git a/plugins/base/src/test/kotlin/utils/ModelUtils.kt b/plugins/base/src/test/kotlin/utils/ModelUtils.kt index 75c8e008..1e6f64c6 100644 --- a/plugins/base/src/test/kotlin/utils/ModelUtils.kt +++ b/plugins/base/src/test/kotlin/utils/ModelUtils.kt @@ -1,8 +1,6 @@ package utils -import org.jetbrains.dokka.model.Module -import org.jetbrains.dokka.model.doc.DocumentationNode -import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.jetbrains.dokka.model.DModule abstract class AbstractModelTest(val path: String? = null, val pkg: String) : ModelDSL(), AssertDSL { @@ -11,7 +9,7 @@ abstract class AbstractModelTest(val path: String? = null, val pkg: String) : Mo platform: String = "jvm", targetList: List = listOf("jvm"), prependPackage: Boolean = true, - block: Module.() -> Unit + block: DModule.() -> Unit ) { val configuration = dokkaConfiguration { passes { diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index 6913ba5b..bf86c1b1 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -1,13 +1,9 @@ package utils -import org.jetbrains.dokka.model.Class +import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.Documentable -import org.jetbrains.dokka.model.Function -import org.jetbrains.dokka.model.Property import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest -import kotlin.reflect.KClass -import kotlin.reflect.full.safeCast @DslMarker annotation class TestDSL @@ -64,5 +60,5 @@ fun T?.assertNotNull(name: String = ""): T = this ?: throw AssertionError("$ fun T?.docs() = this?.documentation.orEmpty().values.flatMap { it.children } -val Class.supers +val DClass.supers get() = supertypes.flatMap{it.component2()} \ No newline at end of file diff --git a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt index cf777e67..991ee07d 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt @@ -4,9 +4,9 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Annotation -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DAnnotation +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.kotlin.builtins.jvm.JavaToKotlinClassMap import org.jetbrains.kotlin.name.ClassId @@ -21,21 +21,21 @@ private fun List.groupedByLocation() = } // TODO: first() does not look reasonable }) { it.second } -internal fun Package.asJava(): Package { +internal fun DPackage.asJava(): DPackage { @Suppress("UNCHECKED_CAST") val syntheticClasses = ((properties + functions) as List) .groupedByLocation() .map { (syntheticClassName, nodes) -> - Class( + DClass( dri = dri.withClass(syntheticClassName), name = syntheticClassName, - properties = nodes.filterIsInstance().map { it.asJava() }, + properties = nodes.filterIsInstance().map { it.asJava() }, constructors = emptyList(), functions = ( - nodes.filterIsInstance() + nodes.filterIsInstance() .map { it.javaAccessors() } + - nodes.filterIsInstance() - .map { it.asJava(syntheticClassName) }) as List, // TODO: methods are static and receiver is a param + nodes.filterIsInstance() + .map { it.asJava(syntheticClassName) }) as List, // TODO: methods are static and receiver is a param classlikes = emptyList(), sources = PlatformDependent.empty(), visibility = PlatformDependent( @@ -60,7 +60,7 @@ internal fun Package.asJava(): Package { ) } -internal fun Property.asJava(isTopLevel: Boolean = false, relocateToClass: String? = null) = +internal fun DProperty.asJava(isTopLevel: Boolean = false, relocateToClass: String? = null) = copy( dri = if (relocateToClass.isNullOrBlank()) { dri @@ -81,7 +81,7 @@ internal fun Property.asJava(isTopLevel: Boolean = false, relocateToClass: Strin extra = if (isTopLevel) extra.plus(extra.mergeAdditionalModifiers(setOf(ExtraModifiers.STATIC))) else extra ) -internal fun Property.javaAccessors(isTopLevel: Boolean = false, relocateToClass: String? = null): List = +internal fun DProperty.javaAccessors(isTopLevel: Boolean = false, relocateToClass: String? = null): List = listOfNotNull( getter?.copy( dri = if (relocateToClass.isNullOrBlank()) { @@ -122,7 +122,7 @@ internal fun Property.javaAccessors(isTopLevel: Boolean = false, relocateToClass ) -internal fun Function.asJava(containingClassName: String): Function { +internal fun DFunction.asJava(containingClassName: String): DFunction { val newName = when { isConstructor -> containingClassName else -> name @@ -137,16 +137,16 @@ internal fun Function.asJava(containingClassName: String): Function { ) // TODO static if toplevel } -internal fun Classlike.asJava(): Classlike = when (this) { - is Class -> asJava() - is Enum -> asJava() - is Annotation -> asJava() - is Object -> asJava() - is Interface -> asJava() +internal fun DClasslike.asJava(): DClasslike = when (this) { + is DClass -> asJava() + is DEnum -> asJava() + is DAnnotation -> asJava() + is DObject -> asJava() + is DInterface -> asJava() else -> throw IllegalArgumentException("$this shouldn't be here") } -internal fun Class.asJava(): Class = copy( +internal fun DClass.asJava(): DClass = copy( constructors = constructors.map { it.asJava(name) }, functions = (functions + properties.map { it.getter } + properties.map { it.setter }).filterNotNull().map { it.asJava(name) @@ -160,7 +160,7 @@ internal fun Class.asJava(): Class = copy( modifier = if (modifier is KotlinModifier.Empty) JavaModifier.Final else modifier ) -private fun TypeParameter.asJava(): TypeParameter = copy( +private fun DTypeParameter.asJava(): DTypeParameter = copy( dri = dri.possiblyAsJava(), bounds = bounds.map { it.asJava() } ) @@ -175,7 +175,7 @@ private fun Bound.asJava(): Bound = when (this) { else -> this } -internal fun Enum.asJava(): Enum = copy( +internal fun DEnum.asJava(): DEnum = copy( constructors = constructors.map { it.asJava(name) }, functions = (functions + properties.map { it.getter } + properties.map { it.setter }).filterNotNull().map { it.asJava(name) @@ -188,12 +188,12 @@ internal fun Enum.asJava(): Enum = copy( // , entries = entries.map { it.asJava() } ) -internal fun Object.asJava(): Object = copy( +internal fun DObject.asJava(): DObject = copy( functions = (functions + properties.map { it.getter } + properties.map { it.setter }) .filterNotNull() .map { it.asJava(name.orEmpty()) }, properties = properties.map { it.asJava() } + - Property( + DProperty( name = "INSTANCE", modifier = JavaModifier.Final, dri = dri.copy(callable = Callable("INSTANCE", null, emptyList())), @@ -209,7 +209,7 @@ internal fun Object.asJava(): Object = copy( getter = null, platformData = platformData, receiver = null, - extra = PropertyContainer.empty() + AdditionalModifiers(setOf(ExtraModifiers.STATIC)) + extra = PropertyContainer.empty() + AdditionalModifiers(setOf(ExtraModifiers.STATIC)) ), classlikes = classlikes.map { it.asJava() }, supertypes = supertypes.copy( @@ -217,7 +217,7 @@ internal fun Object.asJava(): Object = copy( ) ) -internal fun Interface.asJava(): Interface = copy( +internal fun DInterface.asJava(): DInterface = copy( functions = (functions + properties.map { it.getter } + properties.map { it.setter }) .filterNotNull() .map { it.asJava(name) }, @@ -229,13 +229,13 @@ internal fun Interface.asJava(): Interface = copy( ) ) -internal fun Annotation.asJava(): Annotation = copy( +internal fun DAnnotation.asJava(): DAnnotation = copy( properties = properties.map { it.asJava() }, constructors = emptyList(), classlikes = classlikes.map { it.asJava() } ) // TODO investigate if annotation class can have methods and properties not from constructor -internal fun Parameter.asJava(): Parameter = copy( +internal fun DParameter.asJava(): DParameter = copy( type = type.asJava(), name = if (name.isNullOrBlank()) "\$self" else name ) diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 55dd7a97..0ec7d0af 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -5,9 +5,9 @@ import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentCon import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.sureClassNames import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.Annotation -import org.jetbrains.dokka.model.Enum -import org.jetbrains.dokka.model.Function +import org.jetbrains.dokka.model.DAnnotation +import org.jetbrains.dokka.model.DEnum +import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.TextStyle @@ -22,28 +22,28 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge override fun signature(documentable: Documentable): ContentNode = when (documentable) { - is Function -> signature(documentable) - is Property -> signature(documentable) - is Classlike -> signature(documentable) - is TypeParameter -> signature(documentable) + is DFunction -> signature(documentable) + is DProperty -> signature(documentable) + is DClasslike -> signature(documentable) + is DTypeParameter -> signature(documentable) else -> throw NotImplementedError( "Cannot generate signature for ${documentable::class.qualifiedName} ${documentable.name}" ) } - private fun signature(c: Classlike) = contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(c: DClasslike) = contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace)) { platformText(c.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } - if (c is Class) { + if (c is DClass) { text(c.modifier.takeIf { it !in ignoredModifiers }?.name.orEmpty() + " ") } when (c) { - is Class -> text("class ") - is Interface -> text("interface ") - is Enum -> text("enum ") - is Object -> text("class ") - is Annotation -> text("@interface ") + is DClass -> text("class ") + is DInterface -> text("interface ") + is DEnum -> text("enum ") + is DObject -> text("class ") + is DAnnotation -> text("@interface ") } link(c.name!!, c.dri) if (c is WithGenerics) { @@ -60,11 +60,11 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge } } - private fun signature(p: Property) = contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(p: DProperty) = contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace)) { signatureForProjection(p.type) } - private fun signature(f: Function) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun signature(f: DFunction) = contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace)) { text(f.modifier.takeIf { it !in ignoredModifiers }?.name.orEmpty() + " ") val returnType = f.type signatureForProjection(returnType) @@ -82,7 +82,7 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge text(")") } - private fun signature(t: TypeParameter) = contentBuilder.contentFor(t) { + private fun signature(t: DTypeParameter) = contentBuilder.contentFor(t) { text(t.name.substringAfterLast(".")) list(t.bounds, prefix = " extends ") { signatureForProjection(it) diff --git a/plugins/kotlin-as-java/src/main/kotlin/transformers/KotlinAsJavaDocumentableTransformer.kt b/plugins/kotlin-as-java/src/main/kotlin/transformers/KotlinAsJavaDocumentableTransformer.kt index 8f51e105..8b07670f 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/transformers/KotlinAsJavaDocumentableTransformer.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/transformers/KotlinAsJavaDocumentableTransformer.kt @@ -1,11 +1,11 @@ package org.jetbrains.dokka.kotlinAsJava.transformers import org.jetbrains.dokka.kotlinAsJava.converters.asJava -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer class KotlinAsJavaDocumentableTransformer : DocumentableTransformer { - override fun invoke(original: Module, context: DokkaContext): Module = + override fun invoke(original: DModule, context: DokkaContext): DModule = original.copy(packages = original.packages.map { it.asJava() }) } diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 641cc5f9..a0e3b709 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.testApi.testRunner import org.jetbrains.dokka.* -import org.jetbrains.dokka.model.Module +import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.pages.ModulePageNode import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RootPageNode @@ -104,9 +104,9 @@ abstract class AbstractCoreTest { protected class TestBuilder { var analysisSetupStage: (Map) -> Unit = {} var pluginsSetupStage: (DokkaContext) -> Unit = {} - var documentablesCreationStage: (List) -> Unit = {} - var documentablesMergingStage: (Module) -> Unit = {} - var documentablesTransformationStage: (Module) -> Unit = {} + var documentablesCreationStage: (List) -> Unit = {} + var documentablesMergingStage: (DModule) -> Unit = {} + var documentablesTransformationStage: (DModule) -> Unit = {} var pagesGenerationStage: (ModulePageNode) -> Unit = {} var pagesTransformationStage: (RootPageNode) -> Unit = {} var renderingStage: (RootPageNode, DokkaContext) -> Unit = { a, b -> } @@ -216,9 +216,9 @@ abstract class AbstractCoreTest { data class TestMethods( val analysisSetupStage: (Map) -> Unit, val pluginsSetupStage: (DokkaContext) -> Unit, - val documentablesCreationStage: (List) -> Unit, - val documentablesMergingStage: (Module) -> Unit, - val documentablesTransformationStage: (Module) -> Unit, + val documentablesCreationStage: (List) -> Unit, + val documentablesMergingStage: (DModule) -> Unit, + val documentablesTransformationStage: (DModule) -> Unit, val pagesGenerationStage: (ModulePageNode) -> Unit, val pagesTransformationStage: (RootPageNode) -> Unit, val renderingStage: (RootPageNode, DokkaContext) -> Unit -- cgit From fb27b386af878a7cd942e97701b66a0d67f7778c Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Tue, 10 Mar 2020 18:39:19 +0100 Subject: Extract inheritance map --- plugins/base/src/main/kotlin/DokkaBase.kt | 7 +- .../InheritorsExtractorTransformer.kt | 73 +++++++++++++++++ .../documentables/DefaultPageCreator.kt | 11 +++ plugins/base/src/test/kotlin/issues/IssuesTest.kt | 13 +-- plugins/base/src/test/kotlin/model/ClassesTest.kt | 11 +-- .../base/src/test/kotlin/model/FunctionsTest.kt | 10 +-- .../base/src/test/kotlin/model/InheritorsTest.kt | 94 ++++++++++++++++++++++ plugins/base/src/test/kotlin/model/JavaTest.kt | 9 ++- plugins/base/src/test/kotlin/model/PropertyTest.kt | 23 +++--- plugins/base/src/test/kotlin/utils/ModelUtils.kt | 12 ++- plugins/base/src/test/kotlin/utils/TestUtils.kt | 14 +++- 11 files changed, 240 insertions(+), 37 deletions(-) create mode 100644 plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt create mode 100644 plugins/base/src/test/kotlin/model/InheritorsTest.kt (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index f2adcbc1..4af12991 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -9,15 +9,16 @@ import org.jetbrains.dokka.base.resolvers.LocationProviderFactory import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.signatures.SignatureProvider import org.jetbrains.dokka.base.transformers.documentables.DefaultDocumentableMerger +import org.jetbrains.dokka.base.transformers.documentables.InheritorsExtractorTransformer import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter import org.jetbrains.dokka.base.transformers.pages.merger.FallbackPageMergerStrategy import org.jetbrains.dokka.base.transformers.pages.merger.PageMerger import org.jetbrains.dokka.base.transformers.pages.merger.PageMergerStrategy import org.jetbrains.dokka.base.transformers.pages.merger.SameMethodNamePageMergerStrategy -import org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator import org.jetbrains.dokka.base.translators.descriptors.DefaultDescriptorToDocumentableTranslator import org.jetbrains.dokka.base.translators.documentables.DefaultDocumentableToPageTranslator +import org.jetbrains.dokka.base.translators.psi.DefaultPsiToDocumentableTranslator import org.jetbrains.dokka.plugability.DokkaPlugin class DokkaBase : DokkaPlugin() { @@ -45,6 +46,10 @@ class DokkaBase : DokkaPlugin() { } } + val inheritorsExtractor by extending { + CoreExtensions.documentableTransformer with InheritorsExtractorTransformer() + } + val documentableToPageTranslator by extending(isFallback = true) { CoreExtensions.documentableToPageTranslator providing { ctx -> DefaultDocumentableToPageTranslator( diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt new file mode 100644 index 00000000..e372ad9c --- /dev/null +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt @@ -0,0 +1,73 @@ +package org.jetbrains.dokka.base.transformers.documentables + +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.* +import org.jetbrains.dokka.model.properties.ExtraProperty +import org.jetbrains.dokka.model.properties.MergeStrategy +import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.plugability.DokkaContext +import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer + +class InheritorsExtractorTransformer : DocumentableTransformer { + override fun invoke(original: DModule, context: DokkaContext): DModule = + original.generateInheritanceMap().let { inheritanceMap -> original.appendInheritors(inheritanceMap) as DModule } + + private fun T.appendInheritors(inheritanceMap: Map>>): Documentable = + InheritorsInfo(PlatformDependent(inheritanceMap.getForDRI(dri))).let { info -> + when (this) { + is DModule -> copy(packages = packages.map { it.appendInheritors(inheritanceMap) as DPackage }) + is DPackage -> copy(classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + is DClass -> copy( + extra = extra + info, + classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + is DEnum -> copy( + extra = extra + info, + classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + is DInterface -> copy( + extra = extra + info, + classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + is DObject -> copy(classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + is DAnnotation -> copy(classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) + else -> this + } + } + + private fun Map>>.getForDRI(dri: DRI) = + PlatformDependent(map { (v, k) -> + v to k[dri] + }.map { (k, v) -> k to v.orEmpty() }.toMap()) + + private fun DModule.generateInheritanceMap() = + getInheritanceEntriesRec().filterNot { it.second.isEmpty() }.groupBy({ it.first }) { it.second } + .map { (k, v) -> + k to v.flatMap { p -> p.groupBy({ it.first }) { it.second }.toList() } + .groupBy({ it.first }) { it.second }.map { (k2, v2) -> k2 to v2.flatten() }.toMap() + }.toMap() + + private fun T.getInheritanceEntriesRec(): List>>> = + this.toInheritanceEntries() + children.flatMap { it.getInheritanceEntriesRec() } + + private fun T.toInheritanceEntries() = + (this as? WithSupertypes)?.let { + it.supertypes.map.map { (k, v) -> k to v.map { it to dri } } + }.orEmpty() + +} + +class InheritorsInfo(val value: PlatformDependent>) : ExtraProperty { + companion object : ExtraProperty.Key { + override fun mergeStrategyFor(left: InheritorsInfo, right: InheritorsInfo): MergeStrategy = + MergeStrategy.Replace( + InheritorsInfo( + PlatformDependent( + (left.value.map.entries.toList() + right.value.map.entries.toList()) + .groupBy({ it.key }) { it.value } + .map { (k, v) -> k to v.flatten() }.toMap() + ) + ) + ) + } + + override val key: ExtraProperty.Key = InheritorsInfo +} + diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index a0b5a072..eba56625 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -1,12 +1,14 @@ package org.jetbrains.dokka.base.translators.documentables import org.jetbrains.dokka.base.signatures.SignatureProvider +import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.doc.Property import org.jetbrains.dokka.model.doc.TagWrapper +import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.DokkaLogger @@ -85,6 +87,15 @@ open class DefaultPageCreator( text(it.briefDocumentation()) } } + (s as? WithExtraProperties)?.let { it.extra[InheritorsInfo] }?.let { inheritors -> + val map = inheritors.value.map + text("Subclasses:") + platformDependentHint(dri = s.dri, platformData = map.keys) { + map.keys.forEach { pd -> + linkTable(map[pd].orEmpty(), ContentKind.Classlikes, setOf(pd)) + } + } + } } protected open fun contentForClasslike(c: DClasslike) = contentBuilder.contentFor(c) { diff --git a/plugins/base/src/test/kotlin/issues/IssuesTest.kt b/plugins/base/src/test/kotlin/issues/IssuesTest.kt index e34c610a..1ad7a97b 100644 --- a/plugins/base/src/test/kotlin/issues/IssuesTest.kt +++ b/plugins/base/src/test/kotlin/issues/IssuesTest.kt @@ -4,6 +4,7 @@ import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DFunction import org.junit.Test import utils.AbstractModelTest +import utils.name class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues") { @@ -35,14 +36,14 @@ class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues" ) { with((this / "issues" / "Test").cast()) { // passes - (this / "working").cast().type.constructorFqName equals "kotlin.String" - (this / "doSomething").cast().type.constructorFqName equals "kotlin.String" + (this / "working").cast().type.name equals "String" + (this / "doSomething").cast().type.name equals "String" // fails - (this / "brokenGenerics").cast().type.constructorFqName equals "kotlin.collections.List" - (this / "brokenApply").cast().type.constructorFqName equals "issues.Test" - (this / "brokenRun").cast().type.constructorFqName equals "issues.Test" - (this / "brokenLet").cast().type.constructorFqName equals "issues.Test" + (this / "brokenGenerics").cast().type.name equals "List" + (this / "brokenApply").cast().type.name equals "Test" + (this / "brokenRun").cast().type.name equals "Test" + (this / "brokenLet").cast().type.name equals "Test" } } } diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index d627dab4..4855056c 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -6,6 +6,7 @@ import org.jetbrains.dokka.model.DFunction import org.junit.Test import utils.AbstractModelTest import utils.assertNotNull +import utils.name import utils.supers @@ -54,7 +55,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class parameters counts 1 with(parameters.firstOrNull().assertNotNull("Constructor parameter")) { name equals "name" - type.constructorFqName equals "kotlin.String" + type.name equals "String" } } @@ -76,7 +77,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class children counts 5 with((this / "fn").cast()) { - type.constructorFqName equals "kotlin.Unit" + type.name equals "Unit" parameters counts 0 visibility.values allEquals KotlinVisibility.Public } @@ -132,7 +133,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class with((this / "foo").cast()) { name equals "foo" parameters counts 0 - type.constructorFqName equals "kotlin.Unit" + type.name equals "Unit" } } } @@ -172,7 +173,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class ) { with((this / "classes" / "Klass").cast()) { name equals "Klass" - modifier equals KotlinModifier.Sealed + modifier equals Sealed } } } @@ -356,7 +357,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class parameters counts 1 with(parameters.firstOrNull() notNull "Constructor parameter") { name equals "s" - type.constructorFqName equals "kotlin.String" + type.name equals "String" } } } diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index f3a7adc7..97d6b237 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -19,7 +19,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun ) { with((this / "function" / "fn").cast()) { name equals "fn" - type.constructorFqName equals "kotlin.Unit" + type.name equals "Unit" this.children.assertCount(0, "Function children: ") } } @@ -55,7 +55,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun with(fn2) { name equals "fn" parameters.assertCount(1) - parameters.first().type.constructorFqName equals "kotlin.Int" + parameters.first().type.name equals "Int" } } } @@ -94,7 +94,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun name equals "fn" parameters counts 1 receiver.assertNotNull("fn(Int) receiver") - parameters.first().type.constructorFqName equals "kotlin.Int" + parameters.first().type.name equals "Int" } } } @@ -121,11 +121,11 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun parameters counts 1 parameters.firstOrNull().assertNotNull("Parameter: ").also { it.name equals "x" - it.type.constructorFqName equals "kotlin.Int" + it.type.name equals "Int" it.comments() equals "parameter" } - type.assertNotNull("Return type: ").constructorFqName equals "kotlin.Unit" + type.assertNotNull("Return type: ").name equals "Unit" } } } diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt new file mode 100644 index 00000000..b3d7bf92 --- /dev/null +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -0,0 +1,94 @@ +package model + +import org.jetbrains.dokka.CoreExtensions +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.base.transformers.documentables.InheritorsExtractorTransformer +import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo +import org.jetbrains.dokka.model.DInterface +import org.jetbrains.dokka.model.DPackage +import org.jetbrains.dokka.plugability.DokkaPlugin +import org.junit.Test +import utils.AbstractModelTest +import utils.assertNotNull + +class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", "inheritors") { + + object InheritorsPlugin : DokkaPlugin() { + val inheritors by extending { + CoreExtensions.documentableTransformer with InheritorsExtractorTransformer() + } + } + + @Test + fun simple() { + inlineModelTest( + """|interface A{} + |class B() : A {} + """.trimMargin(), + pluginsOverrides = listOf(InheritorsPlugin) + ) { + with((this / "inheritors" / "A").cast()) { + val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value.map + with(map.keys.also { it counts 1 }.find { it.platformType == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! } + ) { + this counts 1 + first().classNames equals "B" + } + } + } + } + + @Test + fun multiplatform() { + val configuration = dokkaConfiguration { + passes { + pass { + sourceRoots = listOf("common/src/", "jvm/src/") + analysisPlatform = "jvm" + targets = listOf("jvm") + } + pass { + sourceRoots = listOf("common/src/", "js/src/") + analysisPlatform = "js" + targets = listOf("js") + } + } + } + + testInline( + """ + |/common/src/main/kotlin/inheritors/Test.kt + |package inheritors + |interface A{} + |/jvm/src/main/kotlin/inheritors/Test.kt + |package inheritors + |class B() : A {} + |/js/src/main/kotlin/inheritors/Test.kt + |package inheritors + |class B() : A {} + |class C() : A {} + """.trimMargin(), + configuration, + cleanupOutput = false, + pluginOverrides = listOf(InheritorsPlugin) + ) { + documentablesTransformationStage = { m -> + with((m / "inheritors" / "A").cast()) { + val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value.map + with(map.keys.also { it counts 2 }) { + with(find { it.platformType == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! }) { + this counts 1 + first().classNames equals "B" + } + with(find { it.platformType == Platform.js }.assertNotNull("js key").let { map[it]!! }) { + this counts 2 + val classes = listOf("B", "C") + assert(all{ classes.contains(it.classNames) }){"One of subclasses missing in js"} + } + } + + } + } + } + } +} \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index c2545e7a..1e33d6fd 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -7,6 +7,7 @@ import org.junit.Assert.assertTrue import org.junit.Test import utils.AbstractModelTest import utils.assertNotNull +import utils.name class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { @@ -134,10 +135,10 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { with((this / "arrayToString").cast()) { name equals "arrayToString" - type.constructorFqName equals "java.lang.String[]" + type.name equals "Array" with(parameters.firstOrNull().assertNotNull("parameters")) { name equals "data" - type.constructorFqName equals "int[]" + type.name equals "Array" } } } @@ -196,7 +197,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { constructors.find { it.parameters.isNullOrEmpty() }.assertNotNull("Test()") with(constructors.find { it.parameters.isNotEmpty() }.assertNotNull("Test(String)")) { - parameters.firstOrNull()?.type?.constructorFqName equals "java.lang.String" + parameters.firstOrNull()?.type?.name equals "String" } } } @@ -238,7 +239,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { name equals "bar" with(parameters.firstOrNull().assertNotNull("parameter")) { name equals "x" - type.constructorFqName equals "java.lang.String..." + type.name equals "Array" } } } diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index d12e292b..4af4ee5a 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -6,6 +6,7 @@ import org.jetbrains.dokka.model.DProperty import org.junit.Test import utils.AbstractModelTest import utils.assertNotNull +import utils.name class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "property") { @@ -19,9 +20,9 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.String" + type.name equals "String" } - type.constructorFqName equals "kotlin.String" + type.name equals "String" } } } @@ -38,9 +39,9 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro children counts 0 setter.assertNotNull("Setter") with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.String" + type.name equals "String" } - type.constructorFqName equals "kotlin.String" + type.name equals "String" } } } @@ -57,9 +58,9 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.String" + type.name equals "String" } - type.constructorFqName equals "kotlin.String" + type.name equals "String" } } } @@ -78,7 +79,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro children counts 0 setter.assertNotNull("Setter") with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.String" + type.name equals "String" } visibility.values allEquals KotlinVisibility.Public } @@ -98,10 +99,10 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro children counts 0 with(receiver.assertNotNull("property receiver")) { name equals null - type.constructorFqName equals "kotlin.String" + type.name equals "String" } with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.Int" + type.name equals "Int" } visibility.values allEquals KotlinVisibility.Public } @@ -125,14 +126,14 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.Int" + type.name equals "Int" } } with((this / "Bar" / "property").cast()) { name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { - type.constructorFqName equals "kotlin.Int" + type.name equals "Int" } } } diff --git a/plugins/base/src/test/kotlin/utils/ModelUtils.kt b/plugins/base/src/test/kotlin/utils/ModelUtils.kt index 1e6f64c6..69c4f0d2 100644 --- a/plugins/base/src/test/kotlin/utils/ModelUtils.kt +++ b/plugins/base/src/test/kotlin/utils/ModelUtils.kt @@ -1,5 +1,6 @@ package utils +import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.model.DModule abstract class AbstractModelTest(val path: String? = null, val pkg: String) : ModelDSL(), AssertDSL { @@ -9,6 +10,8 @@ abstract class AbstractModelTest(val path: String? = null, val pkg: String) : Mo platform: String = "jvm", targetList: List = listOf("jvm"), prependPackage: Boolean = true, + cleanupOutput: Boolean = true, + pluginsOverrides: List = emptyList(), block: DModule.() -> Unit ) { val configuration = dokkaConfiguration { @@ -20,9 +23,14 @@ abstract class AbstractModelTest(val path: String? = null, val pkg: String) : Mo } } } - val prepend = path.let { p -> p?.let { "|$it\n" } ?: "" } + if(prependPackage) "|package $pkg" else "" + val prepend = path.let { p -> p?.let { "|$it\n" } ?: "" } + if (prependPackage) "|package $pkg" else "" - testInline(("$prepend\n$query").trim().trimIndent(), configuration) { + testInline( + query = ("$prepend\n$query").trim().trimIndent(), + configuration = configuration, + cleanupOutput = cleanupOutput, + pluginOverrides = pluginsOverrides + ) { documentablesTransformationStage = block } } diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index bf86c1b1..68ab7120 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -1,9 +1,9 @@ package utils -import org.jetbrains.dokka.model.DClass -import org.jetbrains.dokka.model.Documentable +import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import kotlin.collections.orEmpty @DslMarker annotation class TestDSL @@ -61,4 +61,12 @@ fun T?.assertNotNull(name: String = ""): T = this ?: throw AssertionError("$ fun T?.docs() = this?.documentation.orEmpty().values.flatMap { it.children } val DClass.supers - get() = supertypes.flatMap{it.component2()} \ No newline at end of file + get() = supertypes.flatMap { it.component2() } + +val Bound.name: String? + get() = when (this) { + is Nullable -> inner.name + is OtherParameter -> name + is PrimitiveJavaType -> name + is TypeConstructor -> dri.classNames + } \ No newline at end of file -- cgit From 4002c4e91cb42ef77e93cac57ac49823629d33da Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Thu, 27 Feb 2020 14:50:27 +0100 Subject: Add expect with generation --- plugins/base/src/test/kotlin/basic/DRITest.kt | 5 +- .../base/src/test/kotlin/basic/DokkaBasicTests.kt | 9 +- plugins/base/src/test/kotlin/enums/EnumsTest.kt | 20 +- .../src/test/kotlin/expect/AbstractExpectTest.kt | 104 +++ .../base/src/test/kotlin/expect/ExpectGenerator.kt | 15 + plugins/base/src/test/kotlin/expect/ExpectTest.kt | 70 +- plugins/base/src/test/kotlin/expect/ExpectUtils.kt | 28 + plugins/base/src/test/kotlin/issues/IssuesTest.kt | 2 +- plugins/base/src/test/kotlin/markdown/KDocTest.kt | 4 +- .../base/src/test/kotlin/markdown/ParserTest.kt | 761 +++++++++++++-------- plugins/base/src/test/kotlin/model/ClassesTest.kt | 6 +- plugins/base/src/test/kotlin/model/CommentTest.kt | 2 +- .../base/src/test/kotlin/model/FunctionsTest.kt | 2 +- .../base/src/test/kotlin/model/InheritorsTest.kt | 2 +- plugins/base/src/test/kotlin/model/JavaTest.kt | 6 +- plugins/base/src/test/kotlin/model/PackagesTest.kt | 2 +- plugins/base/src/test/kotlin/model/PropertyTest.kt | 2 +- .../kotlin/multiplatform/BasicMultiplatformTest.kt | 4 +- .../test/kotlin/pageMerger/PageNodeMergerTest.kt | 19 +- .../kotlin/renderers/html/GroupWrappingTest.kt | 2 +- .../renderers/html/PlatformDependentHintTest.kt | 5 +- .../expect/annotatedFunction/out/html/-search.html | 23 + .../annotatedFunction/out/html/navigation.html | 10 + .../expect/annotatedFunction/out/html/root/f.html | 20 + .../annotatedFunction/out/html/root/index.html | 31 + .../annotatedFunction/src/annotatedFunction.kt | 2 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 25 + .../out/html/root/-fancy/-init-.html | 30 + .../out/html/root/-fancy/equals.html | 30 + .../out/html/root/-fancy/hash-code.html | 20 + .../out/html/root/-fancy/index.html | 61 ++ .../out/html/root/-fancy/to-string.html | 20 + .../out/html/root/f.html | 20 + .../out/html/root/index.html | 42 ++ .../annotatedFunctionWithAnnotationParameters.kt | 7 + .../expect/function/out/html/-search.html | 23 + .../expect/function/out/html/navigation.html | 10 + .../expect/function/out/html/root/fn.html | 23 + .../expect/function/out/html/root/index.html | 31 + .../test/resources/expect/function/src/function.kt | 5 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 25 + .../out/html/root/-fancy/-init-.html | 20 + .../out/html/root/-fancy/equals.html | 30 + .../out/html/root/-fancy/hash-code.html | 20 + .../out/html/root/-fancy/index.html | 51 ++ .../out/html/root/-fancy/to-string.html | 20 + .../out/html/root/function.html | 30 + .../out/html/root/index.html | 42 ++ .../src/functionWithAnnotatedParam.kt | 7 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 10 + .../out/html/root/f.html | 30 + .../out/html/root/index.html | 31 + .../src/functionWithDefaultParameter.kt | 1 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 10 + .../out/html/root/function.html | 30 + .../out/html/root/index.html | 31 + .../src/functionWithNoinlineParam.kt | 2 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 10 + .../out/html/root/f.html | 20 + .../out/html/root/index.html | 31 + .../src/functionWithNotDocumentedAnnotation.kt | 2 + .../functionWithParams/out/html/-search.html | 23 + .../functionWithParams/out/html/navigation.html | 10 + .../functionWithParams/out/html/root/function.html | 34 + .../functionWithParams/out/html/root/index.html | 31 + .../functionWithParams/src/functionWithParams.kt | 8 + .../functionWithReceiver/out/html/-search.html | 23 + .../functionWithReceiver/out/html/navigation.html | 10 + .../functionWithReceiver/out/html/root/fn.html | 38 + .../functionWithReceiver/out/html/root/index.html | 36 + .../src/functionWithReceiver.kt | 11 + .../expect/genericFunction/out/html/-search.html | 23 + .../genericFunction/out/html/navigation.html | 10 + .../genericFunction/out/html/root/generic.html | 23 + .../genericFunction/out/html/root/index.html | 31 + .../expect/genericFunction/src/genericFunction.kt | 5 + .../out/html/-search.html | 23 + .../out/html/navigation.html | 10 + .../out/html/root/generic.html | 23 + .../out/html/root/index.html | 31 + .../src/genericFunctionWithConstraints.kt | 6 + .../expect/inlineFunction/out/html/-search.html | 23 + .../expect/inlineFunction/out/html/navigation.html | 10 + .../expect/inlineFunction/out/html/root/f.html | 30 + .../expect/inlineFunction/out/html/root/index.html | 31 + .../expect/inlineFunction/src/inlineFunction.kt | 2 + .../inlineSuspendFunction/out/html/-search.html | 23 + .../inlineSuspendFunction/out/html/navigation.html | 10 + .../inlineSuspendFunction/out/html/root/f.html | 30 + .../inlineSuspendFunction/out/html/root/index.html | 31 + .../src/inlineSuspendFunction.kt | 2 + .../expect/sinceKotlin/out/html/-search.html | 23 + .../expect/sinceKotlin/out/html/navigation.html | 10 + .../out/html/root/available-since1.1.html | 23 + .../expect/sinceKotlin/out/html/root/index.html | 31 + .../expect/sinceKotlin/src/sinceKotlin.kt | 5 + .../expect/suspendFunction/out/html/-search.html | 23 + .../suspendFunction/out/html/navigation.html | 10 + .../expect/suspendFunction/out/html/root/f.html | 20 + .../suspendFunction/out/html/root/index.html | 31 + .../expect/suspendFunction/src/suspendFunction.kt | 2 + .../suspendInlineFunction/out/html/-search.html | 23 + .../suspendInlineFunction/out/html/navigation.html | 10 + .../suspendInlineFunction/out/html/root/f.html | 30 + .../suspendInlineFunction/out/html/root/index.html | 31 + .../src/suspendInlineFunction.kt | 2 + .../test/resources/expect/test/out/-search.html | 23 - .../expect/test/out/images/arrow_down.svg | 3 - .../resources/expect/test/out/images/logo-icon.svg | 3 - .../resources/expect/test/out/images/logo-text.svg | 6 - .../test/resources/expect/test/out/navigation.html | 10 - .../test/resources/expect/test/out/root/fn.html | 23 - .../test/resources/expect/test/out/root/index.html | 31 - .../expect/test/out/scripts/navigationLoader.js | 12 - .../resources/expect/test/out/scripts/pages.js | 5 - .../resources/expect/test/out/scripts/scripts.js | 11 - .../resources/expect/test/out/scripts/search.js | 5 - .../resources/expect/test/out/styles/style.css | 353 ---------- .../src/test/resources/expect/test/src/function.kt | 5 - plugins/build.gradle.kts | 10 +- .../src/test/kotlin/KotlinAsJavaPluginTest.kt | 2 +- 126 files changed, 2563 insertions(+), 885 deletions(-) create mode 100644 plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt create mode 100644 plugins/base/src/test/kotlin/expect/ExpectGenerator.kt create mode 100644 plugins/base/src/test/kotlin/expect/ExpectUtils.kt create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/src/annotatedFunction.kt create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/src/annotatedFunctionWithAnnotationParameters.kt create mode 100644 plugins/base/src/test/resources/expect/function/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/function/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/fn.html create mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/function/src/function.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/src/functionWithAnnotatedParam.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/src/functionWithDefaultParameter.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/src/functionWithNoinlineParam.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/src/functionWithNotDocumentedAnnotation.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/src/functionWithParams.kt create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/src/functionWithReceiver.kt create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/src/genericFunction.kt create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/src/genericFunctionWithConstraints.kt create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/src/inlineFunction.kt create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/src/inlineSuspendFunction.kt create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/src/sinceKotlin.kt create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/src/suspendFunction.kt create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/-search.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/src/suspendInlineFunction.kt delete mode 100644 plugins/base/src/test/resources/expect/test/out/-search.html delete mode 100644 plugins/base/src/test/resources/expect/test/out/images/arrow_down.svg delete mode 100644 plugins/base/src/test/resources/expect/test/out/images/logo-icon.svg delete mode 100644 plugins/base/src/test/resources/expect/test/out/images/logo-text.svg delete mode 100644 plugins/base/src/test/resources/expect/test/out/navigation.html delete mode 100644 plugins/base/src/test/resources/expect/test/out/root/fn.html delete mode 100644 plugins/base/src/test/resources/expect/test/out/root/index.html delete mode 100644 plugins/base/src/test/resources/expect/test/out/scripts/navigationLoader.js delete mode 100644 plugins/base/src/test/resources/expect/test/out/scripts/pages.js delete mode 100644 plugins/base/src/test/resources/expect/test/out/scripts/scripts.js delete mode 100644 plugins/base/src/test/resources/expect/test/out/scripts/search.js delete mode 100644 plugins/base/src/test/resources/expect/test/out/styles/style.css delete mode 100644 plugins/base/src/test/resources/expect/test/src/function.kt (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index ca8e4bad..0e1f095e 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -3,10 +3,11 @@ package basic import org.jetbrains.dokka.links.* import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.asSequence -import org.junit.Assert.assertEquals -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertEquals import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Test + class DRITest : AbstractCoreTest() { @Test fun `#634`() { diff --git a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt index 0405b91c..dae1b2be 100644 --- a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt +++ b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt @@ -2,7 +2,8 @@ package basic import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest class DokkaBasicTests : AbstractCoreTest() { @@ -31,11 +32,11 @@ class DokkaBasicTests : AbstractCoreTest() { ) { pagesGenerationStage = { println(it.dri) - assert(it.getClasslikeToMemberMap().filterKeys { it.name == "Test" }.entries.firstOrNull()?.value?.size == 5) + assertTrue(it.getClasslikeToMemberMap().filterKeys { it.name == "Test" }.entries.firstOrNull()?.value?.size == 5) } } } - fun ModulePageNode.getClasslikeToMemberMap() = - this.parentMap.filterValues { it is ClasslikePageNode }.entries.groupBy ({it.value}){it.key} + private fun ModulePageNode.getClasslikeToMemberMap() = + this.parentMap.filterValues { it is ClasslikePageNode }.entries.groupBy({ it.value }) { it.key } } \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index 34e92d82..55ad0fbc 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -3,9 +3,9 @@ package enums import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.Assert.* -import org.junit.Test +import org.junit.jupiter.api.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Assertions.* class EnumsTest : AbstractCoreTest() { @@ -65,11 +65,11 @@ class EnumsTest : AbstractCoreTest() { configuration ) { documentablesCreationStage = {m -> - assertTrue("Module list cannot be empty", m.isNotEmpty()) + assertTrue(m.isNotEmpty(), "Module list cannot be empty") m.first().packages.let { p -> - assertTrue("Package list cannot be empty", p.isNotEmpty()) + assertTrue(p.isNotEmpty(), "Package list cannot be empty") p.first().classlikes.let { c -> - assertTrue("Classlikes list cannot be empty", c.isNotEmpty()) + assertTrue(c.isNotEmpty(), "Classlikes list cannot be empty") val enum = c.first() as DEnum assertEquals(enum.name, "Test") @@ -78,12 +78,12 @@ class EnumsTest : AbstractCoreTest() { } } } - pagesGenerationStage = { - val map = it.getClasslikeToMemberMap() + pagesGenerationStage = { module -> + val map = module.getClasslikeToMemberMap() val test = map.filterKeys { it.name == "Test" }.values.firstOrNull() - assert(test != null) { "Test not found" } - assert(test!!.any { it.name == "E1" } && test.any { it.name == "E2" }) { "Enum entries missing in parent" } - assert(map.keys.any { it.name == "E1" } && map.keys.any { it.name == "E2" }) { "Enum entries missing" } + assertNotNull(test, "Test not found") + assertTrue(test!!.any { it.name == "E1" } && test.any { it.name == "E2" }) { "Enum entries missing in parent" } + assertTrue(map.keys.any { it.name == "E1" } && map.keys.any { it.name == "E2" }) { "Enum entries missing" } } } } diff --git a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt new file mode 100644 index 00000000..ef97b04c --- /dev/null +++ b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt @@ -0,0 +1,104 @@ +package expect + +import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Assertions.assertTrue +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths +import java.util.concurrent.TimeUnit + +abstract class AbstractExpectTest( + val testDir: Path? = Paths.get("src/test", "resources", "expect"), + val formats: List = listOf("html") +) : AbstractCoreTest() { + + protected fun generateOutput(path: Path, outFormat: String): Path? { + val config = dokkaConfiguration { + format = outFormat + passes { + pass { + sourceRoots = listOf(path.asString()) + } + } + } + + var result: Path? = null + testFromData(config, cleanupOutput = false) { + renderingStage = { _, context -> result = Paths.get(context.configuration.outputDir) } + } + return result + } + + protected fun compareOutput(expected: Path, obtained: Path?, gitTimeout: Long = 500) { + obtained?.let { path -> + val gitCompare = ProcessBuilder( + "git", + "--no-pager", + "diff", + expected.asString(), + path.asString() + ).also { logger.info("git diff command: ${it.command().joinToString(" ")}") } + .also { it.redirectErrorStream() }.start() + + assertTrue(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS)) { "Git timed out after $gitTimeout" } + gitCompare.inputStream.bufferedReader().lines().forEach { logger.info(it) } + assertTrue(gitCompare.exitValue() == 0) { "${path.fileName}: outputs don't match" } + } ?: throw AssertionError("obtained path is null") + } + + protected fun compareOutputWithExcludes( + expected: Path, + obtained: Path?, + excludes: List, + timeout: Long = 500 + ) { + obtained?.let { path -> + val (res, out, err) = runDiff(expected, obtained, excludes, timeout) + assertTrue(res == 0, "Outputs differ:\nstdout - $out\n\nstderr - ${err ?: ""}") + } ?: throw AssertionError("obtained path is null") + } + + protected fun runDiff(exp: Path, obt: Path, excludes: List, timeout: Long): ProcessResult = + ProcessBuilder().command( + listOf("diff", "-ru") + excludes.flatMap { listOf("-x", it) } + listOf("--", exp.asString(), obt.asString()) + ).also { + it.redirectErrorStream() + }.start().also { assertTrue(it.waitFor(timeout, TimeUnit.MILLISECONDS), "diff timed out") }.let { + ProcessResult(it.exitValue(), it.inputStream.bufferResult()) + } + + + protected fun testOutput(p: Path, outFormat: String) { + val expectOut = p.resolve("out/$outFormat") + val testOut = generateOutput(p.resolve("src"), outFormat) + .also { logger.info("Test out: ${it?.asString()}") } + + compareOutput(expectOut.toAbsolutePath(), testOut?.toAbsolutePath()) + testOut?.deleteRecursively() + } + + protected fun testOutputWithExcludes( + p: Path, + outFormat: String, + ignores: List = emptyList(), + timeout: Long = 500 + ) { + val expected = p.resolve("out/$outFormat") + generateOutput(p.resolve("src"), outFormat) + ?.let { obtained -> + compareOutputWithExcludes(expected, obtained, ignores, timeout) + + obtained.deleteRecursively() + } ?: throw AssertionError("Output not generated for ${p.fileName}") + } + + protected fun generateExpect(p: Path, outFormat: String) { + val out = p.resolve("out/$outFormat/") + Files.createDirectories(out) + + val ret = generateOutput(p.resolve("src"), outFormat) + Files.list(out).forEach { it.deleteRecursively() } + ret?.let { Files.list(it).forEach { f -> f.copyRecursively(out.resolve(f.fileName)) } } + } + +} \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt b/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt new file mode 100644 index 00000000..667fc249 --- /dev/null +++ b/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt @@ -0,0 +1,15 @@ +package expect + +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test +import java.nio.file.Files +import java.nio.file.Path + +class ExpectGenerator : AbstractExpectTest() { + + @Disabled + @Test + fun generateAll() = testDir?.dirsWithFormats(formats).orEmpty().forEach { (p, f) -> + generateExpect(p, f) + } +} \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/expect/ExpectTest.kt b/plugins/base/src/test/kotlin/expect/ExpectTest.kt index c6c252ed..0423a5b4 100644 --- a/plugins/base/src/test/kotlin/expect/ExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/ExpectTest.kt @@ -1,62 +1,18 @@ package expect -import org.junit.Test -import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.util.concurrent.TimeUnit - -class ExpectTest : AbstractCoreTest() { - - private fun generateOutput(path: Path): Path? { - val config = dokkaConfiguration { - passes { - pass { - sourceRoots = listOf(path.asString()) - } - } - } - - var result: Path? = null - testFromData(config, cleanupOutput = false) { - renderingStage = { _, context -> result = Paths.get(context.configuration.outputDir) } - } - return result - } - - private fun compareOutput(expected: Path, obtained: Path?, gitTimeout: Long = 500) { - obtained?.let { path -> - val gitCompare = ProcessBuilder( - "git", - "--no-pager", - "diff", - expected.asString(), - path.asString() - ).also { logger.info("git diff command: ${it.command().joinToString(" ")}") } - .start() - - assert(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS)) { "Git timed out after $gitTimeout" } - gitCompare.inputStream.bufferedReader().lines().forEach { logger.info(it) } - gitCompare.errorStream.bufferedReader().lines().forEach { logger.info(it) } - assert(gitCompare.exitValue() == 0) { "${path.fileName}: outputs don't match" } - } ?: throw AssertionError("obtained path is null") +import org.junit.jupiter.api.DynamicTest.dynamicTest +import org.junit.jupiter.api.TestFactory + +class ExpectTest : AbstractExpectTest() { + private val ignores: List = listOf( + "*.js", + "*.css", + "*.svg" + ) + + @TestFactory + fun expectTest() = testDir?.dirsWithFormats(formats).orEmpty().map { (p, f) -> + dynamicTest("${p.fileName}-$f") { testOutputWithExcludes(p, f, ignores) } } - @Test - fun expectTest() { - val sources = Paths.get("src/test", "resources", "expect") - - Files.list(sources).forEach { p -> - val expectOut = p.resolve("out") - val testOut = generateOutput(p.resolve("src")) - .also { logger.info("Test out: ${it?.asString()}") } - - compareOutput(expectOut, testOut) - testOut?.toFile()?.deleteRecursively() - } - } - - fun Path.asString() = toAbsolutePath().normalize().toString() - } \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/expect/ExpectUtils.kt b/plugins/base/src/test/kotlin/expect/ExpectUtils.kt new file mode 100644 index 00000000..4ea46dda --- /dev/null +++ b/plugins/base/src/test/kotlin/expect/ExpectUtils.kt @@ -0,0 +1,28 @@ +package expect + +import java.io.InputStream +import java.nio.file.Files +import java.nio.file.Path +import kotlin.streams.toList + +data class ProcessResult(val code: Int, val out: String, val err: String? = null) + +internal fun Path.dirsWithFormats(formats: List): List> = + Files.list(this).toList().flatMap { p -> formats.map { p to it } } + +internal fun Path.asString() = normalize().toString() +internal fun Path.deleteRecursively() = toFile().deleteRecursively() + +internal fun Path.copyRecursively(target: Path) = toFile().copyRecursively(target.toFile()) + +internal fun Path.listRecursively(filter: (Path) -> Boolean): List = when { + Files.isDirectory(this) -> listOfNotNull(takeIf(filter)) + Files.list(this).toList().flatMap { + it.listRecursively( + filter + ) + } + Files.isRegularFile(this) -> listOfNotNull(this.takeIf(filter)) + else -> emptyList() + } + +internal fun InputStream.bufferResult(): String = this.bufferedReader().lines().toList().joinToString("\n") \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/issues/IssuesTest.kt b/plugins/base/src/test/kotlin/issues/IssuesTest.kt index 1ad7a97b..41fc2632 100644 --- a/plugins/base/src/test/kotlin/issues/IssuesTest.kt +++ b/plugins/base/src/test/kotlin/issues/IssuesTest.kt @@ -2,7 +2,7 @@ package issues import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DFunction -import org.junit.Test +import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.name diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index fa538c3e..a904f725 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -3,7 +3,7 @@ package markdown import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.Assert +import org.junit.jupiter.api.Assertions.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest open class KDocTest : AbstractCoreTest() { @@ -37,7 +37,7 @@ open class KDocTest : AbstractCoreTest() { configuration ) { pagesGenerationStage = { - Assert.assertEquals( + assertEquals( expectedDocumentationNode, actualDocumentationNode(it) ) diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt index dee8e907..332c9766 100644 --- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt +++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt @@ -2,13 +2,14 @@ package org.jetbrains.dokka.tests import markdown.KDocTest import org.jetbrains.dokka.model.doc.* -import org.junit.Ignore -import org.junit.Test +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test class ParserTest : KDocTest() { - @Test fun `Simple text`() { + @Test + fun `Simple text`() { val kdoc = """ | This is simple test of string | Next line @@ -23,7 +24,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Simple text with new line`() { + @Test + fun `Simple text with new line`() { val kdoc = """ | This is simple test of string\ | Next line @@ -31,18 +33,21 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Text("This is simple test of string"), - Br, - Text("Next line") - )) + P( + listOf( + Text("This is simple test of string"), + Br, + Text("Next line") + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Text with Bold and Emphasis decorators`() { + @Test + fun `Text with Bold and Emphasis decorators`() { val kdoc = """ | This is **simple** test of _string_ | Next **_line_** @@ -66,7 +71,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Text with Colon`() { + @Test + fun `Text with Colon`() { val kdoc = """ | This is simple text with: colon! """.trimMargin() @@ -80,7 +86,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Multilined text`() { + @Test + fun `Multilined text`() { val kdoc = """ | Text | and @@ -96,7 +103,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Paragraphs`() { + @Test + fun `Paragraphs`() { val kdoc = """ | Paragraph number | one @@ -119,7 +127,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Emphasis with star`() { + @Test + fun `Emphasis with star`() { val kdoc = " *text*" val expectedDocumentationNode = DocumentationNode( listOf( @@ -131,7 +140,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Underscores that are not Emphasis`() { + @Test + fun `Underscores that are not Emphasis`() { val kdoc = "text_with_underscores" val expectedDocumentationNode = DocumentationNode( listOf( @@ -143,7 +153,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Emphasis with underscores`() { + @Test + fun `Emphasis with underscores`() { val kdoc = "_text_" val expectedDocumentationNode = DocumentationNode( listOf( @@ -155,7 +166,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Embedded star`() { + @Test + fun `Embedded star`() { val kdoc = "Embedded*Star" val expectedDocumentationNode = DocumentationNode( listOf( @@ -168,7 +180,8 @@ class ParserTest : KDocTest() { } - @Test fun `Unordered list`() { + @Test + fun `Unordered list`() { val kdoc = """ | * list item 1 | * list item 2 @@ -188,7 +201,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Unordered list with multilines`() { + @Test + fun `Unordered list with multilines`() { val kdoc = """ | * list item 1 | continue 1 @@ -210,7 +224,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Unordered list with Bold`() { + @Test + fun `Unordered list with Bold`() { val kdoc = """ | * list **item** 1 | continue 1 @@ -220,25 +235,40 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - Ul(listOf( - Li(listOf(P(listOf( - Text("list "), - B(listOf(Text("item"))), - Text(" 1 continue 1") - )))), - Li(listOf(P(listOf( - Text("list "), - B(listOf(Text("item"))), - Text(" 2 continue 2") - )))) - )) + Ul( + listOf( + Li( + listOf( + P( + listOf( + Text("list "), + B(listOf(Text("item"))), + Text(" 1 continue 1") + ) + ) + ) + ), + Li( + listOf( + P( + listOf( + Text("list "), + B(listOf(Text("item"))), + Text(" 2 continue 2") + ) + ) + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Unordered list with nested bullets`() { + @Test + fun `Unordered list with nested bullets`() { val kdoc = """ | * Outer first | Outer next line @@ -255,29 +285,38 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Ul(listOf( - Li(listOf(P(listOf(Text("Outer first Outer next line"))))), - Li(listOf(P(listOf(Text("Outer second"))))), - Ul(listOf( - Li(listOf(P(listOf(Text("Middle first Middle next line"))))), - Li(listOf(P(listOf(Text("Middle second"))))), - Ul(listOf( - Li(listOf(P(listOf(Text("Inner first Inner next line"))))) - )), - Li(listOf(P(listOf(Text("Middle third"))))) - )), - Li(listOf(P(listOf(Text("Outer third"))))) - )), - P(listOf(Text("New paragraph"))) - )) + P( + listOf( + Ul( + listOf( + Li(listOf(P(listOf(Text("Outer first Outer next line"))))), + Li(listOf(P(listOf(Text("Outer second"))))), + Ul( + listOf( + Li(listOf(P(listOf(Text("Middle first Middle next line"))))), + Li(listOf(P(listOf(Text("Middle second"))))), + Ul( + listOf( + Li(listOf(P(listOf(Text("Inner first Inner next line"))))) + ) + ), + Li(listOf(P(listOf(Text("Middle third"))))) + ) + ), + Li(listOf(P(listOf(Text("Outer third"))))) + ) + ), + P(listOf(Text("New paragraph"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Ordered list`() { + @Test + fun `Ordered list`() { val kdoc = """ | 1. list item 1 | 2. list item 2 @@ -299,7 +338,8 @@ class ParserTest : KDocTest() { } - @Test fun `Ordered list beginning from other number`() { + @Test + fun `Ordered list beginning from other number`() { val kdoc = """ | 9. list item 1 | 12. list item 2 @@ -320,7 +360,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Ordered list with multilines`() { + @Test + fun `Ordered list with multilines`() { val kdoc = """ | 2. list item 1 | continue 1 @@ -343,7 +384,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Ordered list with Bold`() { + @Test + fun `Ordered list with Bold`() { val kdoc = """ | 1. list **item** 1 | continue 1 @@ -353,17 +395,30 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - Ol(listOf( - Li(listOf(P(listOf( - Text("list "), - B(listOf(Text("item"))), - Text(" 1 continue 1") - )))), - Li(listOf(P(listOf( - Text("list "), - B(listOf(Text("item"))), - Text(" 2 continue 2") - )))) + Ol( + listOf( + Li( + listOf( + P( + listOf( + Text("list "), + B(listOf(Text("item"))), + Text(" 1 continue 1") + ) + ) + ) + ), + Li( + listOf( + P( + listOf( + Text("list "), + B(listOf(Text("item"))), + Text(" 2 continue 2") + ) + ) + ) + ) ), mapOf("start" to "1") ) @@ -373,7 +428,8 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Ordered list with nested bullets`() { + @Test + fun `Ordered list with nested bullets`() { val kdoc = """ | 1. Outer first | Outer next line @@ -390,35 +446,41 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Ol(listOf( - Li(listOf(P(listOf(Text("Outer first Outer next line"))))), - Li(listOf(P(listOf(Text("Outer second"))))), - Ol(listOf( - Li(listOf(P(listOf(Text("Middle first Middle next line"))))), - Li(listOf(P(listOf(Text("Middle second"))))), - Ol(listOf( - Li(listOf(P(listOf(Text("Inner first Inner next line"))))) + P( + listOf( + Ol( + listOf( + Li(listOf(P(listOf(Text("Outer first Outer next line"))))), + Li(listOf(P(listOf(Text("Outer second"))))), + Ol( + listOf( + Li(listOf(P(listOf(Text("Middle first Middle next line"))))), + Li(listOf(P(listOf(Text("Middle second"))))), + Ol( + listOf( + Li(listOf(P(listOf(Text("Inner first Inner next line"))))) + ), + mapOf("start" to "1") + ), + Li(listOf(P(listOf(Text("Middle third"))))) + ), + mapOf("start" to "1") ), - mapOf("start" to "1") - ), - Li(listOf(P(listOf(Text("Middle third"))))) + Li(listOf(P(listOf(Text("Outer third"))))) ), mapOf("start" to "1") ), - Li(listOf(P(listOf(Text("Outer third"))))) - ), - mapOf("start" to "1") - ), - P(listOf(Text("New paragraph"))) - )) + P(listOf(Text("New paragraph"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Ordered nested in Unordered nested in Ordered list`() { + @Test + fun `Ordered nested in Unordered nested in Ordered list`() { val kdoc = """ | 1. Outer first | Outer next line @@ -435,33 +497,40 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Ol(listOf( - Li(listOf(P(listOf(Text("Outer first Outer next line"))))), - Li(listOf(P(listOf(Text("Outer second"))))), - Ul(listOf( - Li(listOf(P(listOf(Text("Middle first Middle next line"))))), - Li(listOf(P(listOf(Text("Middle second"))))), - Ol(listOf( - Li(listOf(P(listOf(Text("Inner first Inner next line"))))) - ), - mapOf("start" to "1") + P( + listOf( + Ol( + listOf( + Li(listOf(P(listOf(Text("Outer first Outer next line"))))), + Li(listOf(P(listOf(Text("Outer second"))))), + Ul( + listOf( + Li(listOf(P(listOf(Text("Middle first Middle next line"))))), + Li(listOf(P(listOf(Text("Middle second"))))), + Ol( + listOf( + Li(listOf(P(listOf(Text("Inner first Inner next line"))))) + ), + mapOf("start" to "1") + ), + Li(listOf(P(listOf(Text("Middle third"))))) + ) + ), + Li(listOf(P(listOf(Text("Outer third"))))) ), - Li(listOf(P(listOf(Text("Middle third"))))) - )), - Li(listOf(P(listOf(Text("Outer third"))))) - ), - mapOf("start" to "1") - ), - P(listOf(Text("New paragraph"))) - )) + mapOf("start" to "1") + ), + P(listOf(Text("New paragraph"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Header and two paragraphs`() { + @Test + fun `Header and two paragraphs`() { val kdoc = """ | # Header 1 | Following text @@ -471,19 +540,22 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - H1(listOf(Text("Header 1"))), - P(listOf(Text("Following text"))), - P(listOf(Text("New paragraph"))) - )) + P( + listOf( + H1(listOf(Text("Header 1"))), + P(listOf(Text("Following text"))), + P(listOf(Text("New paragraph"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Ignore //TODO: ATX_2 to ATX_6 and sometimes ATX_1 from jetbrains parser consumes white space. Need to handle it in their library - @Test fun `All headers`() { + @Disabled //TODO: ATX_2 to ATX_6 and sometimes ATX_1 from jetbrains parser consumes white space. Need to handle it in their library + @Test + fun `All headers`() { val kdoc = """ | # Header 1 | Text 1 @@ -501,27 +573,30 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - H1(listOf(Text("Header 1"))), - P(listOf(Text("Text 1"))), - H2(listOf(Text("Header 2"))), - P(listOf(Text("Text 2"))), - H3(listOf(Text("Header 3"))), - P(listOf(Text("Text 3"))), - H4(listOf(Text("Header 4"))), - P(listOf(Text("Text 4"))), - H5(listOf(Text("Header 5"))), - P(listOf(Text("Text 5"))), - H6(listOf(Text("Header 6"))), - P(listOf(Text("Text 6"))) - )) + P( + listOf( + H1(listOf(Text("Header 1"))), + P(listOf(Text("Text 1"))), + H2(listOf(Text("Header 2"))), + P(listOf(Text("Text 2"))), + H3(listOf(Text("Header 3"))), + P(listOf(Text("Text 3"))), + H4(listOf(Text("Header 4"))), + P(listOf(Text("Text 4"))), + H5(listOf(Text("Header 5"))), + P(listOf(Text("Text 5"))), + H6(listOf(Text("Header 6"))), + P(listOf(Text("Text 6"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Bold New Line Bold`() { + @Test + fun `Bold New Line Bold`() { val kdoc = """ | **line 1**\ | **line 2** @@ -529,18 +604,21 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - B(listOf(Text("line 1"))), - Br, - B(listOf(Text("line 2"))) - )) + P( + listOf( + B(listOf(Text("line 1"))), + Br, + B(listOf(Text("line 2"))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Horizontal rule`() { + @Test + fun `Horizontal rule`() { val kdoc = """ | *** | text 1 @@ -555,24 +633,27 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - HorizontalRule, - P(listOf(Text("text 1"))), - HorizontalRule, - P(listOf(Text("text 2"))), - HorizontalRule, - P(listOf(Text("text 3"))), - HorizontalRule, - P(listOf(Text("text 4"))), - HorizontalRule - )) + P( + listOf( + HorizontalRule, + P(listOf(Text("text 1"))), + HorizontalRule, + P(listOf(Text("text 2"))), + HorizontalRule, + P(listOf(Text("text 3"))), + HorizontalRule, + P(listOf(Text("text 4"))), + HorizontalRule + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Blockquote`() { + @Test + fun `Blockquote`() { val kdoc = """ | > Blockquotes are very handy in email to emulate reply text. | > This line is part of the same quote. @@ -584,17 +665,25 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - BlockQuote(listOf( - P(listOf( - Text("Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.") - )) - )), - P(listOf(Text("Quote break."))), - BlockQuote(listOf( - P(listOf(Text("Quote"))) - )) - )) + P( + listOf( + BlockQuote( + listOf( + P( + listOf( + Text("Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.") + ) + ) + ) + ), + P(listOf(Text("Quote break."))), + BlockQuote( + listOf( + P(listOf(Text("Quote"))) + ) + ) + ) + ) ) ) ) @@ -602,7 +691,8 @@ class ParserTest : KDocTest() { } - @Test fun `Blockquote nested`() { + @Test + fun `Blockquote nested`() { val kdoc = """ | > text 1 | > text 2 @@ -618,27 +708,36 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - BlockQuote(listOf( - P(listOf(Text("text 1 text 2"))), - BlockQuote(listOf( - P(listOf(Text("text 3 text 4"))) - )), - P(listOf(Text("text 5"))) - )), - P(listOf(Text("Quote break."))), - BlockQuote(listOf( - P(listOf(Text("Quote"))) - )) - )) + P( + listOf( + BlockQuote( + listOf( + P(listOf(Text("text 1 text 2"))), + BlockQuote( + listOf( + P(listOf(Text("text 3 text 4"))) + ) + ), + P(listOf(Text("text 5"))) + ) + ), + P(listOf(Text("Quote break."))), + BlockQuote( + listOf( + P(listOf(Text("Quote"))) + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Ignore //TODO: Again ATX_1 consumes white space - @Test fun `Blockquote nested with fancy text enhancement`() { + @Disabled //TODO: Again ATX_1 consumes white space + @Test + fun `Blockquote nested with fancy text enhancement`() { val kdoc = """ | > text **1** | > text 2 @@ -655,36 +754,51 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - BlockQuote(listOf( - P(listOf( - Text("text "), - B(listOf(Text("1"))), - Text("\ntext 2") - )), - BlockQuote(listOf( - H1(listOf(Text("text 3"))), - Ul(listOf( - Li(listOf(P(listOf(Text("text 4"))))), - Ul(listOf( - Li(listOf(P(listOf(Text("text 5"))))) - ) - ))) - )), - P(listOf(Text("text 6"))) - )), - P(listOf(Text("Quote break."))), - BlockQuote(listOf( - P(listOf(Text("Quote"))) - )) - )) + P( + listOf( + BlockQuote( + listOf( + P( + listOf( + Text("text "), + B(listOf(Text("1"))), + Text("\ntext 2") + ) + ), + BlockQuote( + listOf( + H1(listOf(Text("text 3"))), + Ul( + listOf( + Li(listOf(P(listOf(Text("text 4"))))), + Ul( + listOf( + Li(listOf(P(listOf(Text("text 5"))))) + ) + ) + ) + ) + ) + ), + P(listOf(Text("text 6"))) + ) + ), + P(listOf(Text("Quote break."))), + BlockQuote( + listOf( + P(listOf(Text("Quote"))) + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Simple Code Block`() { + @Test + fun `Simple Code Block`() { val kdoc = """ | `Some code` | Sample text @@ -692,17 +806,20 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Code(listOf(Text("Some code"))), - Text(" Sample text") - )) + P( + listOf( + Code(listOf(Text("Some code"))), + Text(" Sample text") + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Multilined Code Block`() { + @Test + fun `Multilined Code Block`() { val kdoc = """ | ```kotlin | val x: Int = 0 @@ -718,20 +835,22 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Code( - listOf( - Text("val x: Int = 0"), Br, - Text("val y: String = \"Text\""), Br, Br, - Text(" val z: Boolean = true"), Br, - Text("for(i in 0..10) {"), Br, - Text(" println(i)"), Br, - Text("}") + P( + listOf( + Code( + listOf( + Text("val x: Int = 0"), Br, + Text("val y: String = \"Text\""), Br, Br, + Text(" val z: Boolean = true"), Br, + Text("for(i in 0..10) {"), Br, + Text(" println(i)"), Br, + Text("}") + ), + mapOf("lang" to "kotlin") ), - mapOf("lang" to "kotlin") - ), - P(listOf(Text("Sample text"))) - )) + P(listOf(Text("Sample text"))) + ) + ) ) ) ) @@ -739,41 +858,52 @@ class ParserTest : KDocTest() { } - @Test fun `Inline link`() { + @Test + fun `Inline link`() { val kdoc = """ | [I'm an inline-style link](https://www.google.com) """.trimMargin() val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf(A( - listOf(Text("I'm an inline-style link")), - mapOf("href" to "https://www.google.com") - ))) + P( + listOf( + A( + listOf(Text("I'm an inline-style link")), + mapOf("href" to "https://www.google.com") + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Inline link with title`() { + @Test + fun `Inline link with title`() { val kdoc = """ | [I'm an inline-style link with title](https://www.google.com "Google's Homepage") """.trimMargin() val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf(A( - listOf(Text("I'm an inline-style link with title")), - mapOf("href" to "https://www.google.com", "title" to "Google's Homepage") - ))) + P( + listOf( + A( + listOf(Text("I'm an inline-style link with title")), + mapOf("href" to "https://www.google.com", "title" to "Google's Homepage") + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Full reference link`() { + @Test + fun `Full reference link`() { val kdoc = """ | [I'm a reference-style link][Arbitrary case-insensitive reference text] | @@ -782,17 +912,26 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf(P(listOf(A( - listOf(Text("I'm a reference-style link")), - mapOf("href" to "https://www.mozilla.org") - ))))) + P( + listOf( + P( + listOf( + A( + listOf(Text("I'm a reference-style link")), + mapOf("href" to "https://www.mozilla.org") + ) + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Full reference link with number`() { + @Test + fun `Full reference link with number`() { val kdoc = """ | [You can use numbers for reference-style link definitions][1] | @@ -801,17 +940,26 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf(P(listOf(A( - listOf(Text("You can use numbers for reference-style link definitions")), - mapOf("href" to "http://slashdot.org") - ))))) + P( + listOf( + P( + listOf( + A( + listOf(Text("You can use numbers for reference-style link definitions")), + mapOf("href" to "http://slashdot.org") + ) + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Short reference link`() { + @Test + fun `Short reference link`() { val kdoc = """ | Or leave it empty and use the [link text itself]. | @@ -820,21 +968,28 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf(P(listOf( - Text("Or leave it empty and use the "), - A( - listOf(Text("link text itself")), - mapOf("href" to "http://www.reddit.com") - ), - Text(".") - )))) + P( + listOf( + P( + listOf( + Text("Or leave it empty and use the "), + A( + listOf(Text("link text itself")), + mapOf("href" to "http://www.reddit.com") + ), + Text(".") + ) + ) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Autolink`() { + @Test + fun `Autolink`() { val kdoc = """ | URLs and URLs in angle brackets will automatically get turned into links. | http://www.example.com or and sometimes @@ -843,21 +998,24 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Text("URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or "), - A( - listOf(Text("http://www.example.com")), - mapOf("href" to "http://www.example.com") - ), - Text(" and sometimes example.com (but not on Github, for example).") - )) + P( + listOf( + Text("URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or "), + A( + listOf(Text("http://www.example.com")), + mapOf("href" to "http://www.example.com") + ), + Text(" and sometimes example.com (but not on Github, for example).") + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Various links`() { + @Test + fun `Various links`() { val kdoc = """ | [I'm an inline-style link](https://www.google.com) | @@ -882,55 +1040,80 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - P(listOf(A( - listOf(Text("I'm an inline-style link")), - mapOf("href" to "https://www.google.com") - ))), - P(listOf(A( - listOf(Text("I'm an inline-style link with title")), - mapOf("href" to "https://www.google.com", "title" to "Google's Homepage") - ))), - P(listOf(A( - listOf(Text("I'm a reference-style link")), - mapOf("href" to "https://www.mozilla.org") - ))), - P(listOf(A( - listOf(Text("You can use numbers for reference-style link definitions")), - mapOf("href" to "http://slashdot.org") - ))), - P(listOf( - Text("Or leave it empty and use the "), - A( - listOf(Text("link text itself")), - mapOf("href" to "http://www.reddit.com") + P( + listOf( + P( + listOf( + A( + listOf(Text("I'm an inline-style link")), + mapOf("href" to "https://www.google.com") + ) + ) ), - Text(".") - )), - P(listOf( - Text("URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or "), - A( - listOf(Text("http://www.example.com")), - mapOf("href" to "http://www.example.com") + P( + listOf( + A( + listOf(Text("I'm an inline-style link with title")), + mapOf("href" to "https://www.google.com", "title" to "Google's Homepage") + ) + ) ), - Text(" and sometimes example.com (but not on Github, for example).") - )), - P(listOf(Text("Some text to show that the reference links can follow later."))) - )) + P( + listOf( + A( + listOf(Text("I'm a reference-style link")), + mapOf("href" to "https://www.mozilla.org") + ) + ) + ), + P( + listOf( + A( + listOf(Text("You can use numbers for reference-style link definitions")), + mapOf("href" to "http://slashdot.org") + ) + ) + ), + P( + listOf( + Text("Or leave it empty and use the "), + A( + listOf(Text("link text itself")), + mapOf("href" to "http://www.reddit.com") + ), + Text(".") + ) + ), + P( + listOf( + Text("URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or "), + A( + listOf(Text("http://www.example.com")), + mapOf("href" to "http://www.example.com") + ), + Text(" and sometimes example.com (but not on Github, for example).") + ) + ), + P(listOf(Text("Some text to show that the reference links can follow later."))) + ) + ) ) ) ) executeTest(kdoc, expectedDocumentationNode) } - @Test fun `Windows Carriage Return Line Feed`() { + @Test + fun `Windows Carriage Return Line Feed`() { val kdoc = "text\r\ntext" val expectedDocumentationNode = DocumentationNode( listOf( Description( - P(listOf( - Text("text text") - )) + P( + listOf( + Text("text text") + ) + ) ) ) ) diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index 4855056c..2f83d8c0 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -1,9 +1,9 @@ package model import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.KotlinModifier.* import org.jetbrains.dokka.model.DFunction -import org.junit.Test +import org.jetbrains.dokka.model.KotlinModifier.* +import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull import utils.name @@ -151,7 +151,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class name equals "Klass" visibility.values allEquals KotlinVisibility.Public with(extra[AdditionalModifiers.AdditionalKey].assertNotNull("Extras")) { - content.find{it == ExtraModifiers.DATA}.assertNotNull("data modifier") + content.find { it == ExtraModifiers.DATA }.assertNotNull("data modifier") } } } diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt index 055892af..b1faa07f 100644 --- a/plugins/base/src/test/kotlin/model/CommentTest.kt +++ b/plugins/base/src/test/kotlin/model/CommentTest.kt @@ -3,7 +3,7 @@ package model import org.jetbrains.dokka.model.DProperty import org.jetbrains.dokka.model.doc.CustomWrapperTag import org.jetbrains.dokka.model.doc.Text -import org.junit.Test +import org.junit.jupiter.api.Test import utils.* class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comment") { diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index 97d6b237..c8b8f2ba 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -2,7 +2,7 @@ package model import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.DPackage -import org.junit.Test +import org.junit.jupiter.api.Test import utils.* class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "function") { diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index b3d7bf92..da128803 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -7,7 +7,7 @@ import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.model.DInterface import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.plugability.DokkaPlugin -import org.junit.Test +import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 1e33d6fd..c6d111a4 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -3,8 +3,8 @@ package model import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.DFunction -import org.junit.Assert.assertTrue -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull import utils.name @@ -112,8 +112,8 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { with((this / "java" / "Foo").cast()) { val sups = listOf("Exception", "Cloneable") assertTrue( - "Foo must extend ${sups.joinToString(", ")}", sups.all { s -> supertypes.map.values.flatten().any { it.classNames == s } }) + "Foo must extend ${sups.joinToString(", ")}" } } } diff --git a/plugins/base/src/test/kotlin/model/PackagesTest.kt b/plugins/base/src/test/kotlin/model/PackagesTest.kt index 008ae14d..8885dae0 100644 --- a/plugins/base/src/test/kotlin/model/PackagesTest.kt +++ b/plugins/base/src/test/kotlin/model/PackagesTest.kt @@ -1,7 +1,7 @@ package model import org.jetbrains.dokka.model.DPackage -import org.junit.Test +import org.junit.jupiter.api.Test import utils.AbstractModelTest class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "packages") { diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index 4af4ee5a..f391df4e 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -3,7 +3,7 @@ package model import org.jetbrains.dokka.model.KotlinVisibility import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.model.DProperty -import org.junit.Test +import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull import utils.name diff --git a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt index e9605c5f..0111e8fb 100644 --- a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt +++ b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt @@ -1,7 +1,7 @@ package multiplatform -import org.junit.Assert.assertEquals -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest class BasicMultiplatformTest : AbstractCoreTest() { diff --git a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt index 4b90604e..15dc5581 100644 --- a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt +++ b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt @@ -1,13 +1,10 @@ package pageMerger -import org.jetbrains.dokka.CoreExtensions import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.PageNode -import org.jetbrains.dokka.plugability.DokkaPlugin -import org.jetbrains.dokka.base.transformers.pages.merger.SameMethodNamePageMergerStrategy -import org.jetbrains.dokka.utilities.DokkaLogger -import org.junit.Ignore -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest class PageNodeMergerTest : AbstractCoreTest() { @@ -70,16 +67,16 @@ class PageNodeMergerTest : AbstractCoreTest() { val testT = allChildren.filter { it.name == "testT" } val test = allChildren.filter { it.name == "test" } - assert(testT.size == 1) { "There can be only one testT page" } - assert(testT.first().dri.size == 2) { "testT page should have 2 DRI, but has ${testT.first().dri.size}" } + assertTrue(testT.size == 1) { "There can be only one testT page" } + assertTrue(testT.first().dri.size == 2) { "testT page should have 2 DRI, but has ${testT.first().dri.size}" } - assert(test.size == 1) { "There can be only one test page" } - assert(test.first().dri.size == 2) { "test page should have 2 DRI, but has ${test.first().dri.size}" } + assertTrue(test.size == 1) { "There can be only one test page" } + assertTrue(test.first().dri.size == 2) { "test page should have 2 DRI, but has ${test.first().dri.size}" } } } } - @Ignore("TODO: reenable when we have infrastructure for turning off extensions") + @Disabled("TODO: reenable when we have infrastructure for turning off extensions") @Test fun defaultStrategyTest() { val strList: MutableList = mutableListOf() diff --git a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt index e98b97c0..f39d845a 100644 --- a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt @@ -2,7 +2,7 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle -import org.junit.Test +import org.junit.jupiter.api.Test import renderers.RenderingOnlyTestBase import renderers.TestPage diff --git a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt index 2fda1ee1..f1d50007 100644 --- a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt @@ -3,13 +3,12 @@ package renderers.html import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.PlatformData -import org.jetbrains.dokka.pages.Style import org.jetbrains.dokka.pages.TextStyle -import org.junit.Test +import org.junit.jupiter.api.Test import renderers.RenderingOnlyTestBase import renderers.TestPage -class PlatformDependentHintTest: RenderingOnlyTestBase() { +class PlatformDependentHintTest : RenderingOnlyTestBase() { private val pl1 = PlatformData("pl1", Platform.js, listOf("pl1")) private val pl2 = PlatformData("pl2", Platform.jvm, listOf("pl2")) private val pl3 = PlatformData("pl3", Platform.native, listOf("pl3")) diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html new file mode 100644 index 00000000..7900fb98 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html @@ -0,0 +1,20 @@ + + + f + + + + + + +
//root//f +

f

+final fun f()
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html new file mode 100644 index 00000000..867d7faa --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f()
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/src/annotatedFunction.kt b/plugins/base/src/test/resources/expect/annotatedFunction/src/annotatedFunction.kt new file mode 100644 index 00000000..f7abbf6c --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/src/annotatedFunction.kt @@ -0,0 +1,2 @@ +@Strictfp fun f() { +} diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/-search.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html new file mode 100644 index 00000000..fe9e499e --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html @@ -0,0 +1,25 @@ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html new file mode 100644 index 00000000..5ae21e5b --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html @@ -0,0 +1,30 @@ + + + <init> + + + + + + +
//root//Fancy/<init> +

<init>

+final fun <init>(size: Int) +

Parameters

+ + + + + + + +
size
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html new file mode 100644 index 00000000..004f5344 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html @@ -0,0 +1,30 @@ + + + equals + + + + + + +
//root//Fancy/equals +

equals

+open fun equals(other: Any): Boolean +

Parameters

+ + + + + + + +
other
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html new file mode 100644 index 00000000..b395dcda --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html @@ -0,0 +1,20 @@ + + + hashCode + + + + + + +
//root//Fancy/hashCode +

hashCode

+open fun hashCode(): Int
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html new file mode 100644 index 00000000..3da5f79b --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html @@ -0,0 +1,61 @@ + + + Fancy + + + + + + +
//root//FancyFinal class Fancy : Annotation +

Constructors

+ + + + + + + + + +
<init>final fun <init>(size: Int)
+

Functions

+ + + + + + + + + + + + + + + + + + + +
equalsopen fun equals(other: Any): Boolean
hashCodeopen fun hashCode(): Int
toStringopen fun toString(): String
+

Properties

+ + + + + + + + +
size
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html new file mode 100644 index 00000000..84da7873 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html @@ -0,0 +1,20 @@ + + + toString + + + + + + +
//root//Fancy/toString +

toString

+open fun toString(): String
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html new file mode 100644 index 00000000..7900fb98 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html @@ -0,0 +1,20 @@ + + + f + + + + + + +
//root//f +

f

+final fun f()
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html new file mode 100644 index 00000000..bba04c93 --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html @@ -0,0 +1,42 @@ + + + + + + + + + +
//root/ +

Package

+

Types

+ + + + + + + + + +
FancyFinal class Fancy : Annotation
+

Functions

+ + + + + + + + + +
ffinal fun f()
+
+ + + diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/src/annotatedFunctionWithAnnotationParameters.kt b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/src/annotatedFunctionWithAnnotationParameters.kt new file mode 100644 index 00000000..e559713a --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/src/annotatedFunctionWithAnnotationParameters.kt @@ -0,0 +1,7 @@ +@Target(AnnotationTarget.VALUE_PARAMETER) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +public annotation class Fancy(val size: Int) + + +@Fancy(1) fun f() {} diff --git a/plugins/base/src/test/resources/expect/function/out/html/-search.html b/plugins/base/src/test/resources/expect/function/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/function/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/function/out/html/navigation.html b/plugins/base/src/test/resources/expect/function/out/html/navigation.html new file mode 100644 index 00000000..ebff817d --- /dev/null +++ b/plugins/base/src/test/resources/expect/function/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/fn.html b/plugins/base/src/test/resources/expect/function/out/html/root/fn.html new file mode 100644 index 00000000..e87d7bc4 --- /dev/null +++ b/plugins/base/src/test/resources/expect/function/out/html/root/fn.html @@ -0,0 +1,23 @@ + + + fn + + + + + + +
//root//fn +

fn

+final fun fn() +

Description

+Function fn +
+ + + diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/index.html b/plugins/base/src/test/resources/expect/function/out/html/root/index.html new file mode 100644 index 00000000..25c65b11 --- /dev/null +++ b/plugins/base/src/test/resources/expect/function/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
fnfinal fun fn()Function fn
+
+ + + diff --git a/plugins/base/src/test/resources/expect/function/src/function.kt b/plugins/base/src/test/resources/expect/function/src/function.kt new file mode 100644 index 00000000..3ed81dfa --- /dev/null +++ b/plugins/base/src/test/resources/expect/function/src/function.kt @@ -0,0 +1,5 @@ +/** + * Function fn + */ +fun fn() { +} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html new file mode 100644 index 00000000..53fb1ca2 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html @@ -0,0 +1,25 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html new file mode 100644 index 00000000..acfc127a --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html @@ -0,0 +1,20 @@ + + + <init> + + + + + + +
//root//Fancy/<init> +

<init>

+final fun <init>()
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html new file mode 100644 index 00000000..004f5344 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html @@ -0,0 +1,30 @@ + + + equals + + + + + + +
//root//Fancy/equals +

equals

+open fun equals(other: Any): Boolean +

Parameters

+ + + + + + + +
other
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html new file mode 100644 index 00000000..b395dcda --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html @@ -0,0 +1,20 @@ + + + hashCode + + + + + + +
//root//Fancy/hashCode +

hashCode

+open fun hashCode(): Int
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html new file mode 100644 index 00000000..6a1d3c92 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html @@ -0,0 +1,51 @@ + + + Fancy + + + + + + +
//root//FancyFinal class Fancy : Annotation +

Constructors

+ + + + + + + + + +
<init>final fun <init>()
+

Functions

+ + + + + + + + + + + + + + + + + + + +
equalsopen fun equals(other: Any): Boolean
hashCodeopen fun hashCode(): Int
toStringopen fun toString(): String
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html new file mode 100644 index 00000000..84da7873 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html @@ -0,0 +1,20 @@ + + + toString + + + + + + +
//root//Fancy/toString +

toString

+open fun toString(): String
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html new file mode 100644 index 00000000..2c0eb890 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html @@ -0,0 +1,30 @@ + + + function + + + + + + +
//root//function +

function

+final fun function(notInlined: Function0<Unit>) +

Parameters

+ + + + + + + +
notInlined
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html new file mode 100644 index 00000000..1797f269 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html @@ -0,0 +1,42 @@ + + + + + + + + + +
//root/ +

Package

+

Types

+ + + + + + + + + +
FancyFinal class Fancy : Annotation
+

Functions

+ + + + + + + + + +
functionfinal fun function(notInlined: Function0<Unit>)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/src/functionWithAnnotatedParam.kt b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/src/functionWithAnnotatedParam.kt new file mode 100644 index 00000000..f858e671 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/src/functionWithAnnotatedParam.kt @@ -0,0 +1,7 @@ +@Target(AnnotationTarget.VALUE_PARAMETER) +@Retention(AnnotationRetention.SOURCE) +@MustBeDocumented +public annotation class Fancy + +fun function(@Fancy notInlined: () -> Unit) { +} diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html new file mode 100644 index 00000000..448fdf25 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html @@ -0,0 +1,30 @@ + + + f + + + + + + +
//root//f +

f

+final fun f(x: String) +

Parameters

+ + + + + + + +
x
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html new file mode 100644 index 00000000..d23b9737 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f(x: String)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/src/functionWithDefaultParameter.kt b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/src/functionWithDefaultParameter.kt new file mode 100644 index 00000000..3a3a102f --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/src/functionWithDefaultParameter.kt @@ -0,0 +1 @@ +fun f(x: String = "") {} diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html new file mode 100644 index 00000000..659c441f --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html new file mode 100644 index 00000000..2c0eb890 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html @@ -0,0 +1,30 @@ + + + function + + + + + + +
//root//function +

function

+final fun function(notInlined: Function0<Unit>) +

Parameters

+ + + + + + + +
notInlined
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html new file mode 100644 index 00000000..2c53c3e2 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
functionfinal fun function(notInlined: Function0<Unit>)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/src/functionWithNoinlineParam.kt b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/src/functionWithNoinlineParam.kt new file mode 100644 index 00000000..640bec83 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/src/functionWithNoinlineParam.kt @@ -0,0 +1,2 @@ +fun function(noinline notInlined: () -> Unit) { +} diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html new file mode 100644 index 00000000..7900fb98 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html @@ -0,0 +1,20 @@ + + + f + + + + + + +
//root//f +

f

+final fun f()
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html new file mode 100644 index 00000000..867d7faa --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f()
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/src/functionWithNotDocumentedAnnotation.kt b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/src/functionWithNotDocumentedAnnotation.kt new file mode 100644 index 00000000..3c7e2ff9 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/src/functionWithNotDocumentedAnnotation.kt @@ -0,0 +1,2 @@ +@Suppress("FOO") fun f() { +} diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html new file mode 100644 index 00000000..659c441f --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html new file mode 100644 index 00000000..0c62a13d --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html @@ -0,0 +1,34 @@ + + + function + + + + + + +
//root//function +

function

+final fun function(x: Int) +

Description

+MultilineFunction Documentation + +

Parameters

+ + + + + + + + +
xparameter
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html new file mode 100644 index 00000000..a5fdacb0 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
functionfinal fun function(x: Int)Multiline Function Documentation
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithParams/src/functionWithParams.kt b/plugins/base/src/test/resources/expect/functionWithParams/src/functionWithParams.kt new file mode 100644 index 00000000..85c49368 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithParams/src/functionWithParams.kt @@ -0,0 +1,8 @@ +/** + * Multiline + * + * Function + * Documentation + */ +fun function(/** parameter */ x: Int) { +} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/-search.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html new file mode 100644 index 00000000..ebff817d --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html new file mode 100644 index 00000000..fc3630fc --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html @@ -0,0 +1,38 @@ + + + fn + + + + + + +
//root//fn +

fn

+final fun String.fn() +

Description

+Function with receiver + +

fn

+final fun String.fn(x: Int) +

Description

+Function with receiver + +

Parameters

+ + + + + + + +
x
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html new file mode 100644 index 00000000..cd92f78d --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html @@ -0,0 +1,36 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + + + + + + +
fnfinal fun String.fn()Function with receiver
fnfinal fun String.fn(x: Int)Function with receiver
+
+ + + diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/src/functionWithReceiver.kt b/plugins/base/src/test/resources/expect/functionWithReceiver/src/functionWithReceiver.kt new file mode 100644 index 00000000..c8473251 --- /dev/null +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/src/functionWithReceiver.kt @@ -0,0 +1,11 @@ +/** + * Function with receiver + */ +fun String.fn() { +} + +/** + * Function with receiver + */ +fun String.fn(x: Int) { +} diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html new file mode 100644 index 00000000..dc7dcf2d --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html new file mode 100644 index 00000000..a8f1dbd1 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html @@ -0,0 +1,23 @@ + + + generic + + + + + + +
//root//generic +

generic

+private final fun generic<generic.T : Any>() +

Description

+generic function +
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html new file mode 100644 index 00000000..e89383c9 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
genericprivate final fun generic<generic.T : Any>()generic function
+
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunction/src/genericFunction.kt b/plugins/base/src/test/resources/expect/genericFunction/src/genericFunction.kt new file mode 100644 index 00000000..05a65070 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunction/src/genericFunction.kt @@ -0,0 +1,5 @@ + +/** + * generic function + */ +private fun generic() {} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/-search.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html new file mode 100644 index 00000000..dc7dcf2d --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html new file mode 100644 index 00000000..cd1945f8 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html @@ -0,0 +1,23 @@ + + + generic + + + + + + +
//root//generic +

generic

+final fun generic<generic.T : org.jetbrains.kotlin.protobuf.GeneratedMessageLite$GeneratedExtension@5a8ec9b6, generic.R : Any>() +

Description

+generic function +
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html new file mode 100644 index 00000000..016b01e7 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
genericfinal fun generic()generic function
+
+ + + diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/src/genericFunctionWithConstraints.kt b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/src/genericFunctionWithConstraints.kt new file mode 100644 index 00000000..5f22f8c5 --- /dev/null +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/src/genericFunctionWithConstraints.kt @@ -0,0 +1,6 @@ + +/** + * generic function + */ +public fun generic() { +} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html new file mode 100644 index 00000000..0661e211 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html @@ -0,0 +1,30 @@ + + + f + + + + + + +
//root//f +

f

+final fun f(a: Function0<String>) +

Parameters

+ + + + + + + +
a
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html new file mode 100644 index 00000000..a5dd2a5d --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f(a: Function0<String>)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineFunction/src/inlineFunction.kt b/plugins/base/src/test/resources/expect/inlineFunction/src/inlineFunction.kt new file mode 100644 index 00000000..64a617a4 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineFunction/src/inlineFunction.kt @@ -0,0 +1,2 @@ +inline fun f(a: () -> String) { +} diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html new file mode 100644 index 00000000..0661e211 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html @@ -0,0 +1,30 @@ + + + f + + + + + + +
//root//f +

f

+final fun f(a: Function0<String>) +

Parameters

+ + + + + + + +
a
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html new file mode 100644 index 00000000..a5dd2a5d --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f(a: Function0<String>)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/src/inlineSuspendFunction.kt b/plugins/base/src/test/resources/expect/inlineSuspendFunction/src/inlineSuspendFunction.kt new file mode 100644 index 00000000..5f376267 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/src/inlineSuspendFunction.kt @@ -0,0 +1,2 @@ +inline suspend fun f(a: () -> String) { +} diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/-search.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html new file mode 100644 index 00000000..5f182c80 --- /dev/null +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html new file mode 100644 index 00000000..42aa89c4 --- /dev/null +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html @@ -0,0 +1,23 @@ + + + availableSince1.1 + + + + + + +
//root//availableSince1.1 +

availableSince1.1

+final fun availableSince1.1(): String +

Description

+Quite useful String +
+ + + diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html new file mode 100644 index 00000000..65836c49 --- /dev/null +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
availableSince1.1final fun availableSince1.1(): StringQuite useful String
+
+ + + diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/src/sinceKotlin.kt b/plugins/base/src/test/resources/expect/sinceKotlin/src/sinceKotlin.kt new file mode 100644 index 00000000..cdcd3357 --- /dev/null +++ b/plugins/base/src/test/resources/expect/sinceKotlin/src/sinceKotlin.kt @@ -0,0 +1,5 @@ +/** + * Quite useful [String] + */ +@SinceKotlin("1.1") +fun `availableSince1.1`(): String = "1.1 rulezz" \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html new file mode 100644 index 00000000..7900fb98 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html @@ -0,0 +1,20 @@ + + + f + + + + + + +
//root//f +

f

+final fun f()
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html new file mode 100644 index 00000000..867d7faa --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f()
+
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendFunction/src/suspendFunction.kt b/plugins/base/src/test/resources/expect/suspendFunction/src/suspendFunction.kt new file mode 100644 index 00000000..49ecca2a --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendFunction/src/suspendFunction.kt @@ -0,0 +1,2 @@ +suspend fun f() { +} diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/-search.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/-search.html new file mode 100644 index 00000000..1ee812bb --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/-search.html @@ -0,0 +1,23 @@ + + + Search + + + + + + +
+

Search results for

+ + +
+
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html new file mode 100644 index 00000000..ad2005c3 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html @@ -0,0 +1,10 @@ + + diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html new file mode 100644 index 00000000..0661e211 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html @@ -0,0 +1,30 @@ + + + f + + + + + + +
//root//f +

f

+final fun f(a: Function0<String>) +

Parameters

+ + + + + + + +
a
+
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html new file mode 100644 index 00000000..a5dd2a5d --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html @@ -0,0 +1,31 @@ + + + + + + + + + +
//root/ +

Package

+

Functions

+ + + + + + + + + +
ffinal fun f(a: Function0<String>)
+
+ + + diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/src/suspendInlineFunction.kt b/plugins/base/src/test/resources/expect/suspendInlineFunction/src/suspendInlineFunction.kt new file mode 100644 index 00000000..54f65658 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/src/suspendInlineFunction.kt @@ -0,0 +1,2 @@ +suspend inline fun f(a: () -> String) { +} diff --git a/plugins/base/src/test/resources/expect/test/out/-search.html b/plugins/base/src/test/resources/expect/test/out/-search.html deleted file mode 100644 index 1ee812bb..00000000 --- a/plugins/base/src/test/resources/expect/test/out/-search.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Search - - - - - - -
-

Search results for

- - -
-
- - - diff --git a/plugins/base/src/test/resources/expect/test/out/images/arrow_down.svg b/plugins/base/src/test/resources/expect/test/out/images/arrow_down.svg deleted file mode 100644 index 89e7df47..00000000 --- a/plugins/base/src/test/resources/expect/test/out/images/arrow_down.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/plugins/base/src/test/resources/expect/test/out/images/logo-icon.svg b/plugins/base/src/test/resources/expect/test/out/images/logo-icon.svg deleted file mode 100644 index 1b3b3670..00000000 --- a/plugins/base/src/test/resources/expect/test/out/images/logo-icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/plugins/base/src/test/resources/expect/test/out/images/logo-text.svg b/plugins/base/src/test/resources/expect/test/out/images/logo-text.svg deleted file mode 100644 index 7bf3e6c5..00000000 --- a/plugins/base/src/test/resources/expect/test/out/images/logo-text.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/plugins/base/src/test/resources/expect/test/out/navigation.html b/plugins/base/src/test/resources/expect/test/out/navigation.html deleted file mode 100644 index ebff817d..00000000 --- a/plugins/base/src/test/resources/expect/test/out/navigation.html +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/plugins/base/src/test/resources/expect/test/out/root/fn.html b/plugins/base/src/test/resources/expect/test/out/root/fn.html deleted file mode 100644 index e87d7bc4..00000000 --- a/plugins/base/src/test/resources/expect/test/out/root/fn.html +++ /dev/null @@ -1,23 +0,0 @@ - - - fn - - - - - - -
//root//fn -

fn

-final fun fn() -

Description

-Function fn -
- - - diff --git a/plugins/base/src/test/resources/expect/test/out/root/index.html b/plugins/base/src/test/resources/expect/test/out/root/index.html deleted file mode 100644 index 25c65b11..00000000 --- a/plugins/base/src/test/resources/expect/test/out/root/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - -
//root/ -

Package

-

Functions

- - - - - - - - - -
fnfinal fun fn()Function fn
-
- - - diff --git a/plugins/base/src/test/resources/expect/test/out/scripts/navigationLoader.js b/plugins/base/src/test/resources/expect/test/out/scripts/navigationLoader.js deleted file mode 100644 index 99a885a9..00000000 --- a/plugins/base/src/test/resources/expect/test/out/scripts/navigationLoader.js +++ /dev/null @@ -1,12 +0,0 @@ -onload = () => { - fetch(pathToRoot + "navigation.html") - .then(response => response.text()) - .then(data => { - document.getElementById("sideMenu").innerHTML = data; - }).then(() => { - document.querySelectorAll(".overview > a").forEach(link => { - link.setAttribute("href", pathToRoot + link.getAttribute("href")) - console.log(link.attributes["href"]) - }) - }) -} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/test/out/scripts/pages.js b/plugins/base/src/test/resources/expect/test/out/scripts/pages.js deleted file mode 100644 index c0bd7a2f..00000000 --- a/plugins/base/src/test/resources/expect/test/out/scripts/pages.js +++ /dev/null @@ -1,5 +0,0 @@ -var pages = [ -{ "name": "root", "location": "root/index.html" }, -{ "name": "", "location": "root//index.html" }, -{ "name": "fn", "location": "root//fn.html" } -] diff --git a/plugins/base/src/test/resources/expect/test/out/scripts/scripts.js b/plugins/base/src/test/resources/expect/test/out/scripts/scripts.js deleted file mode 100644 index c2e29b9f..00000000 --- a/plugins/base/src/test/resources/expect/test/out/scripts/scripts.js +++ /dev/null @@ -1,11 +0,0 @@ -document.getElementById("navigationFilter").oninput = function (e) { - var input = e.target.value; - var menuParts = document.getElementsByClassName("sideMenuPart") - for (let part of menuParts) { - if(part.querySelector("a").textContent.startsWith(input)) { - part.classList.remove("filtered"); - } else { - part.classList.add("filtered"); - } - } -} \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/test/out/scripts/search.js b/plugins/base/src/test/resources/expect/test/out/scripts/search.js deleted file mode 100644 index 63112ac5..00000000 --- a/plugins/base/src/test/resources/expect/test/out/scripts/search.js +++ /dev/null @@ -1,5 +0,0 @@ -var query = new URLSearchParams(window.location.search).get("query"); - document.getElementById("searchTitle").innerHTML += '"' + query + '":'; - document.getElementById("searchTable").innerHTML = pages.filter(el => el.name.startsWith(query)).reduce((acc, element) => { return acc + - '' + element.name + '' - }, ""); \ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/test/out/styles/style.css b/plugins/base/src/test/resources/expect/test/out/styles/style.css deleted file mode 100644 index 4a76dd96..00000000 --- a/plugins/base/src/test/resources/expect/test/out/styles/style.css +++ /dev/null @@ -1,353 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Open+Sans:300i,400,700); - - -#content { - margin-top: 3em; - margin-left: 15em; -} - -#navigation { - position: relative -} - -#sideMenu, #searchBar { - position: absolute; -} - -#sideMenu { - width: 14em; - padding-left: 0.5em; -} - -#sideMenu .sideMenuPart { - margin-left: 1em; -} - -#sideMenu img { - margin: 1em 0.25em; -} - -#sideMenu hr { - background: #DADFE6; -} - -#searchBar { - width: 100%; - pointer-events: none; -} - -#searchForm { - float: right; - pointer-events: all; -} - -.sideMenuPart > .navButton { - margin-left:0.25em -} - -.sideMenuPart > .overview .navButtonContent::after { - float: right; - content: url("../images/arrow_down.svg"); -} - -.sideMenuPart.hidden > .navButton .navButtonContent::after { - content: '\02192'; -} - -.sideMenuPart.hidden > .sideMenuPart { - display: none; -} - -.filtered > a, .filtered > .navButton { - display: none; -} - -body, table{ - font:14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; - background: #F4F4F4; - font-weight:300; - margin-left: auto; - margin-right: auto; - max-width: 1440px; -} - -table { - display: flex; - padding:5px; -} - -td:first-child { - width: 20vw; -} - -.keyword { - color:black; - font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; - font-size:12px; -} - -.symbol { - font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; - font-size:12px; -} - -.identifier { - color: darkblue; - font-size:12px; - font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; -} - -h1, h2, h3, h4, h5, h6 { - color:#222; - margin:0 0 20px; -} - -p, ul, ol, table, pre, dl { - margin:0 0 20px; -} - -h1, h2, h3 { - line-height:1.1; -} - -h1 { - font-size:28px; -} - -h2 { - color:#393939; -} - -h3, h4, h5, h6 { - color:#494949; -} - -a { - color:#258aaf; - font-weight:400; - text-decoration:none; -} - -a:hover { - color: inherit; - text-decoration:underline; -} - -a small { - font-size:11px; - color:#555; - margin-top:-0.6em; - display:block; -} - -.wrapper { - width:860px; - margin:0 auto; -} - -blockquote { - border-left:1px solid #e5e5e5; - margin:0; - padding:0 0 0 20px; - font-style:italic; -} - -code, pre { - font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; - color:#333; - font-size:12px; -} - -pre { - display: block; -/* - padding:8px 8px; - background: #f8f8f8; - border-radius:5px; - border:1px solid #e5e5e5; -*/ - overflow-x: auto; -} - -table { - width:100%; - border-collapse:collapse; -} - -th, td { - text-align:left; - vertical-align: top; - padding:5px 10px; -} - -dt { - color:#444; - font-weight:700; -} - -th { - color:#444; -} - -img { - max-width:100%; -} - -header { - width:270px; - float:left; - position:fixed; -} - -header ul { - list-style:none; - height:40px; - - padding:0; - - background: #eee; - background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); - background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - - border-radius:5px; - border:1px solid #d2d2d2; - box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0; - width:270px; -} - -header li { - width:89px; - float:left; - border-right:1px solid #d2d2d2; - height:40px; -} - -header ul a { - line-height:1; - font-size:11px; - color:#999; - display:block; - text-align:center; - padding-top:6px; - height:40px; -} - -strong { - color:#222; - font-weight:700; -} - -header ul li + li { - width:88px; - border-left:1px solid #fff; -} - -header ul li + li + li { - border-right:none; - width:89px; -} - -header ul a strong { - font-size:14px; - display:block; - color:#222; -} - -section { - width:500px; - float:right; - padding-bottom:50px; -} - -small { - font-size:11px; -} - -hr { - border:0; - background:#e5e5e5; - height:1px; - margin:0 0 20px; -} - -footer { - width:270px; - float:left; - position:fixed; - bottom:50px; -} - -@media print, screen and (max-width: 960px) { - - div.wrapper { - width:auto; - margin:0; - } - - header, section, footer { - float:none; - position:static; - width:auto; - } - - header { - padding-right:320px; - } - - section { - border:1px solid #e5e5e5; - border-width:1px 0; - padding:20px 0; - margin:0 0 20px; - } - - header a small { - display:inline; - } - - header ul { - position:absolute; - right:50px; - top:52px; - } -} - -@media print, screen and (max-width: 720px) { - body { - word-wrap:break-word; - } - - header { - padding:0; - } - - header ul, header p.view { - position:static; - } - - pre, code { - word-wrap:normal; - } -} - -@media print, screen and (max-width: 480px) { - body { - padding:15px; - } - - header ul { - display:none; - } -} - -@media print { - body { - padding:0.4in; - font-size:12pt; - color:#444; - } -} diff --git a/plugins/base/src/test/resources/expect/test/src/function.kt b/plugins/base/src/test/resources/expect/test/src/function.kt deleted file mode 100644 index 3ed81dfa..00000000 --- a/plugins/base/src/test/resources/expect/test/src/function.kt +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Function fn - */ -fun fn() { -} \ No newline at end of file diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts index a95b612e..c7c29140 100644 --- a/plugins/build.gradle.kts +++ b/plugins/build.gradle.kts @@ -9,6 +9,14 @@ subprojects { implementation(kotlin("stdlib-jdk8")) testImplementation(project(":testApi")) - testImplementation("junit:junit:4.13") + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") + } + + tasks.test { + useJUnitPlatform() + ignoreFailures = true + testLogging { + events("passed", "skipped", "failed") + } } } \ No newline at end of file diff --git a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt index 780f326a..2a9ddf0e 100644 --- a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt +++ b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt @@ -4,8 +4,8 @@ import org.jetbrains.dokka.pages.ContentGroup import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentTable import org.jetbrains.dokka.pages.children -import org.junit.Test import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Test class KotlinAsJavaPluginTest : AbstractCoreTest() { -- cgit From 03329b0eb98b309d208839344052633028e00984 Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Wed, 18 Mar 2020 14:19:54 +0100 Subject: Fix minor bugs and add core tests --- core/src/main/kotlin/model/aditionalExtras.kt | 22 +- .../DefaultDescriptorToDocumentableTranslator.kt | 2 +- plugins/base/src/test/kotlin/enums/EnumsTest.kt | 6 +- plugins/base/src/test/kotlin/model/ClassesTest.kt | 173 +++++------ .../base/src/test/kotlin/model/FunctionsTest.kt | 321 ++++++++++++--------- .../base/src/test/kotlin/model/InheritorsTest.kt | 4 +- plugins/base/src/test/kotlin/model/JavaTest.kt | 109 +++++-- plugins/base/src/test/kotlin/model/PropertyTest.kt | 59 +++- .../test/kotlin/pageMerger/PageNodeMergerTest.kt | 10 +- plugins/base/src/test/kotlin/utils/TestUtils.kt | 5 + .../kotlin/converters/KotlinToJavaConverter.kt | 2 +- 11 files changed, 431 insertions(+), 282 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index b0755759..f7d37111 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -5,22 +5,34 @@ import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy class AdditionalModifiers(val content: Set) : ExtraProperty { - object AdditionalKey : ExtraProperty.Key { + companion object : ExtraProperty.Key { override fun mergeStrategyFor( left: AdditionalModifiers, right: AdditionalModifiers ): MergeStrategy = MergeStrategy.Replace(AdditionalModifiers(left.content + right.content)) } - override fun equals(other: Any?): Boolean = if (other is AdditionalModifiers) other.content == content else false + override fun equals(other: Any?): Boolean = + if (other is AdditionalModifiers) other.content == content else false + override fun hashCode() = content.hashCode() - override val key: ExtraProperty.Key = AdditionalKey + override val key: ExtraProperty.Key = AdditionalModifiers } class Annotations(val content: List) : ExtraProperty { - companion object : ExtraProperty.Key + companion object : ExtraProperty.Key { + override fun mergeStrategyFor(left: Annotations, right: Annotations): MergeStrategy = + MergeStrategy.Replace(Annotations((left.content + right.content).distinct())) + } override val key: ExtraProperty.Key = Annotations - data class Annotation(val dri: DRI, val params: Map) + data class Annotation(val dri: DRI, val params: Map) { + override fun equals(other: Any?): Boolean = when(other) { + is Annotation -> dri.equals(other.dri) + else -> false + } + + override fun hashCode(): Int = dri.hashCode() + } } \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 8e0f1231..44679d8d 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -367,7 +367,7 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv type = descriptor.type.toBound(), documentation = descriptor.resolveDescriptorData(platformData), platformData = listOf(platformData), - extra = PropertyContainer.withAll(descriptor.additionalExtras()) + extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) private fun MemberScope.functions(parent: DRIWithPlatformInfo): List = diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index 55ad0fbc..c9024a72 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -34,9 +34,9 @@ class EnumsTest : AbstractCoreTest() { pagesGenerationStage = { val map = it.getClasslikeToMemberMap() val test = map.filterKeys { it.name == "Test" }.values.firstOrNull() - assert(test != null) { "Test not found" } - assert(test!!.any { it.name == "E1" } && test.any { it.name == "E2" }) { "Enum entries missing in parent" } - assert(map.keys.any { it.name == "E1" } && map.keys.any { it.name == "E2" }) { "Enum entries missing" } + assertTrue(test != null) { "Test not found" } + assertTrue(test!!.any { it.name == "E1" } && test.any { it.name == "E2" }) { "Enum entries missing in parent" } + assertTrue(map.keys.any { it.name == "E1" } && map.keys.any { it.name == "E2" }) { "Enum entries missing" } } } } diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index bd35afc5..336023da 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -1,7 +1,6 @@ package model import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.KotlinModifier.* import org.junit.jupiter.api.Test import utils.AbstractModelTest @@ -150,20 +149,14 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class with((this / "classes" / "Klass").cast()) { name equals "Klass" visibility.values allEquals KotlinVisibility.Public - with(extra[AdditionalModifiers.AdditionalKey].assertNotNull("Extras")) { - content.find { it == ExtraModifiers.DATA }.assertNotNull("data modifier") + with(extra[AdditionalModifiers].assertNotNull("Extras")) { + content counts 1 + content.first() equals ExtraModifiers.DATA } } } } -// @Test fun dataClass() { -// verifyPackageMember("testdata/classes/dataClass.kt", defaultModelConfig) { cls -> -// val modifiers = cls.details(NodeKind.Modifier).map { it.name } -// assertTrue("data" in modifiers) -// } -// } - @Test fun sealedClass() { inlineModelTest( @@ -178,30 +171,25 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } -// // TODO modifiers -// @Test fun annotatedClassWithAnnotationParameters() { -// checkSourceExistsAndVerifyModel( -// "testdata/classes/annotatedClassWithAnnotationParameters.kt", -// defaultModelConfig -// ) { model -> -// with(model.members.single().members.single()) { -// with(deprecation!!) { -// assertEquals("Deprecated", name) -// assertEquals(Content.Empty, content) -// assertEquals(NodeKind.Annotation, kind) -// assertEquals(1, details.count()) -// with(details[0]) { -// assertEquals(NodeKind.Parameter, kind) -// assertEquals(1, details.count()) -// with(details[0]) { -// assertEquals(NodeKind.Value, kind) -// assertEquals("\"should no longer be used\"", name) -// } -// } -// } -// } -// } -// } + @Test + fun annotatedClassWithAnnotationParameters() { + inlineModelTest( + """ + |@Deprecated("should no longer be used") class Foo() {} + """ + ) { + with((this / "classes" / "Foo").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + this.content counts 1 + with(content.first()) { + dri.classNames equals "Deprecated" + params.entries counts 1 + params["message"].assertNotNull("message") equals "should no longer be used" + } + } + } + } + } @Test fun notOpenClass() { @@ -272,7 +260,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } - @Test // todo inner class + @Test fun innerClass() { inlineModelTest( """ @@ -284,21 +272,15 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class with((this / "classes" / "C").cast()) { with((this / "D").cast()) { + with(extra[AdditionalModifiers].assertNotNull("AdditionalModifiers")) { + content counts 1 + content.first() equals ExtraModifiers.INNER + } } } } } -// // TODO modifiers -// @Test fun innerClass() { -// verifyPackageMember("testdata/classes/innerClass.kt", defaultModelConfig) { cls -> -// val innerClass = cls.members.single { it.name == "D" } -// val modifiers = innerClass.details(NodeKind.Modifier) -// assertEquals(3, modifiers.size) -// assertEquals("inner", modifiers[2].name) -// } -// } - @Test fun companionObjectExtension() { inlineModelTest( @@ -364,14 +346,29 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } - // TODO modifiers -// @Test fun sinceKotlin() { -// checkSourceExistsAndVerifyModel("testdata/classes/sinceKotlin.kt", defaultModelConfig) { model -> -// with(model.members.single().members.single()) { -// assertEquals("1.1", sinceKotlin) -// } -// } -// } + @Test + fun sinceKotlin() { + inlineModelTest( + """ + |/** + | * Useful + | */ + |@SinceKotlin("1.1") + |class C + """ + ) { + with((this / "classes" / "C").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + this.content counts 1 + with(content.first()) { + dri.classNames equals "SinceKotlin" + params.entries counts 1 + params["version"].assertNotNull("version") equals "1.1" + } + } + } + } + } @Test fun privateCompanionObject() { @@ -402,7 +399,8 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } - @Test fun annotatedClass() { + @Test + fun annotatedClass() { inlineModelTest( """@Suppress("abc") class Foo() {}""" ) { @@ -417,47 +415,30 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } - // TODO annotations -// @Test fun annotatedClass() { -// verifyPackageMember("testdata/classes/annotatedClass.kt", ModelConfig( -// analysisPlatform = analysisPlatform, -// withKotlinRuntime = true -// ) -// ) { cls -> -// Assert.assertEquals(1, cls.annotations.count()) -// with(cls.annotations[0]) { -// Assert.assertEquals("Strictfp", name) -// Assert.assertEquals(Content.Empty, content) -// Assert.assertEquals(NodeKind.Annotation, kind) -// } -// } -// } - - -// TODO annotations - -// @Test fun javaAnnotationClass() { -// checkSourceExistsAndVerifyModel( -// "testdata/classes/javaAnnotationClass.kt", -// modelConfig = ModelConfig(analysisPlatform = analysisPlatform, withJdk = true) -// ) { model -> -// with(model.members.single().members.single()) { -// Assert.assertEquals(1, annotations.count()) -// with(annotations[0]) { -// Assert.assertEquals("Retention", name) -// Assert.assertEquals(Content.Empty, content) -// Assert.assertEquals(NodeKind.Annotation, kind) -// with(details[0]) { -// Assert.assertEquals(NodeKind.Parameter, kind) -// Assert.assertEquals(1, details.count()) -// with(details[0]) { -// Assert.assertEquals(NodeKind.Value, kind) -// Assert.assertEquals("RetentionPolicy.SOURCE", name) -// } -// } -// } -// } -// } -// } + @Test fun javaAnnotationClass() { + inlineModelTest( + """ + |import java.lang.annotation.Retention + |import java.lang.annotation.RetentionPolicy + | + |@Retention(RetentionPolicy.SOURCE) + |public annotation class throws() + """ + ) { + with((this / "classes" / "throws").cast()) { + with(extra[AdditionalModifiers].assertNotNull("AdditionalModifiers")) { + content counts 1 + content.first() equals ExtraModifiers.OVERRIDE // ?? + } + with(extra[Annotations].assertNotNull("Annotations")) { + content counts 1 + with(content.first()) { + dri.classNames equals "Retention" + params["value"].assertNotNull("value") equals "(java/lang/annotation/RetentionPolicy, SOURCE)" + } + } + } + } + } } \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index c8b8f2ba..068c2895 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -1,9 +1,11 @@ package model -import org.jetbrains.dokka.model.DFunction -import org.jetbrains.dokka.model.DPackage +import org.jetbrains.dokka.model.* import org.junit.jupiter.api.Test -import utils.* +import utils.AbstractModelTest +import utils.assertNotNull +import utils.comments +import utils.name class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "function") { @@ -130,8 +132,6 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun } } -// TODO add modifiers - start - @Test fun functionWithNotDocumentedAnnotation() { inlineModelTest( @@ -139,20 +139,19 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |@Suppress("FOO") fun f() {} """ ) { - // TODO add annotations - with((this / "function" / "f").cast()) { - assert(false) { "No annotation data" } + with(extra[Annotations].assertNotNull("Annotations")) { + content counts 1 + with(content.first()) { + dri.classNames equals "Suppress" + params.entries counts 1 + params["names"].assertNotNull("names") equals "[\"FOO\"]" + } + } } } } -// @Test fun functionWithNotDocumentedAnnotation() { -// verifyPackageMember("testdata/functions/functionWithNotDocumentedAnnotation.kt", defaultModelConfig) { func -> -// assertEquals(0, func.annotations.count()) -// } -// } - @Test fun inlineFunction() { inlineModelTest( @@ -160,21 +159,13 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |inline fun f(a: () -> String) {} """ ) { - // TODO add data about inline - with((this / "function" / "f").cast()) { - assert(false) { "No inline data" } + extra[AdditionalModifiers]?.content counts 1 + extra[AdditionalModifiers]?.content exists ExtraModifiers.INLINE } } } -// @Test fun inlineFunction() { -// verifyPackageMember("testdata/functions/inlineFunction.kt", defaultModelConfig) { func -> -// val modifiers = func.details(NodeKind.Modifier).map { it.name } -// assertTrue("inline" in modifiers) -// } -// } - @Test fun suspendFunction() { inlineModelTest( @@ -182,112 +173,167 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun |suspend fun f() {} """ ) { - // TODO add data about suspend + with((this / "function" / "f").cast()) { + extra[AdditionalModifiers]?.content counts 1 + extra[AdditionalModifiers]?.content exists ExtraModifiers.SUSPEND + } + } + } + @Test + fun suspendInlineFunctionOrder() { + inlineModelTest( + """ + |suspend inline fun f(a: () -> String) {} + """ + ) { with((this / "function" / "f").cast()) { - assert(false) { "No suspend data" } + extra[AdditionalModifiers]?.content counts 2 + extra[AdditionalModifiers]?.content exists ExtraModifiers.SUSPEND + extra[AdditionalModifiers]?.content exists ExtraModifiers.INLINE } } } -// @Test fun suspendFunction() { -// verifyPackageMember("testdata/functions/suspendFunction.kt") { func -> -// val modifiers = func.details(NodeKind.Modifier).map { it.name } -// assertTrue("suspend" in modifiers) -// } -// } + @Test + fun inlineSuspendFunctionOrderChanged() { + inlineModelTest( + """ + |inline suspend fun f(a: () -> String) {} + """ + ) { + with((this / "function" / "f").cast()) { + with(extra[AdditionalModifiers].assertNotNull("AdditionalModifiers")) { + content counts 2 + content exists ExtraModifiers.SUSPEND + content exists ExtraModifiers.INLINE + } + } + } + } -// @Test fun suspendInlineFunctionOrder() { -// verifyPackageMember("testdata/functions/suspendInlineFunction.kt") { func -> -// val modifiers = func.details(NodeKind.Modifier).map { it.name }.filter { -// it == "suspend" || it == "inline" -// } -// -// assertEquals(listOf("suspend", "inline"), modifiers) -// } -// } -// -// @Test fun inlineSuspendFunctionOrderChanged() { -// verifyPackageMember("testdata/functions/inlineSuspendFunction.kt") { func -> -// val modifiers = func.details(NodeKind.Modifier).map { it.name }.filter { -// it == "suspend" || it == "inline" -// } -// -// assertEquals(listOf("suspend", "inline"), modifiers) -// } -// } -// -// @Test fun functionWithAnnotatedParam() { -// checkSourceExistsAndVerifyModel("testdata/functions/functionWithAnnotatedParam.kt", defaultModelConfig) { model -> -// with(model.members.single().members.single { it.name == "function" }) { -// with(details(NodeKind.Parameter).first()) { -// assertEquals(1, annotations.count()) -// with(annotations[0]) { -// assertEquals("Fancy", name) -// assertEquals(Content.Empty, content) -// assertEquals(NodeKind.Annotation, kind) -// } -// } -// } -// } -// } -// -// @Test fun functionWithNoinlineParam() { -// verifyPackageMember("testdata/functions/functionWithNoinlineParam.kt", defaultModelConfig) { func -> -// with(func.details(NodeKind.Parameter).first()) { -// val modifiers = details(NodeKind.Modifier).map { it.name } -// assertTrue("noinline" in modifiers) -// } -// } -// } -// -// @Test fun annotatedFunctionWithAnnotationParameters() { -// checkSourceExistsAndVerifyModel( -// "testdata/functions/annotatedFunctionWithAnnotationParameters.kt", -// defaultModelConfig -// ) { model -> -// with(model.members.single().members.single { it.name == "f" }) { -// assertEquals(1, annotations.count()) -// with(annotations[0]) { -// assertEquals("Fancy", name) -// assertEquals(Content.Empty, content) -// assertEquals(NodeKind.Annotation, kind) -// assertEquals(1, details.count()) -// with(details[0]) { -// assertEquals(NodeKind.Parameter, kind) -// assertEquals(1, details.count()) -// with(details[0]) { -// assertEquals(NodeKind.Value, kind) -// assertEquals("1", name) -// } -// } -// } -// } -// } -// } + @Test + fun functionWithAnnotatedParam() { + inlineModelTest( + """ + |@Target(AnnotationTarget.VALUE_PARAMETER) + |@Retention(AnnotationRetention.SOURCE) + |@MustBeDocumented + |public annotation class Fancy + | + |fun function(@Fancy notInlined: () -> Unit) {} + """ + ) { + with((this / "function" / "Fancy").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + content counts 3 + with(content.map { it.dri.classNames to it }.toMap()) { + with(this["Target"].assertNotNull("Target")) { + params["allowedTargets"].assertNotNull("allowedTargets") equals "[AnnotationTarget.VALUE_PARAMETER]" + } + with(this["Retention"].assertNotNull("Retention")) { + params["value"].assertNotNull("value") equals "(kotlin/annotation/AnnotationRetention, SOURCE)" + } + this["MustBeDocumented"].assertNotNull("MustBeDocumented").params.entries counts 0 + } + } + + } + with((this / "function" / "function" / "notInlined").cast()) { + with(this.extra[Annotations].assertNotNull("Annotations")) { + content counts 1 + with(content.first()) { + dri.classNames equals "Fancy" + params.entries counts 0 + } + } + } + } + } -// TODO add modifiers - end + @Test + fun functionWithNoinlineParam() { + inlineModelTest( + """ + |fun f(noinline notInlined: () -> Unit) {} + """ + ) { + with((this / "function" / "f" / "notInlined").cast()) { + extra[AdditionalModifiers]?.content counts 1 + extra[AdditionalModifiers]?.content exists ExtraModifiers.NOINLINE + } + } + } -// @Test -// fun functionWithDefaultParameter() { -// inlineModelTest( -// """ -// |/src/main/kotlin/function/Test.kt -// |package function -// |fun f(x: String = "") {} -// """ -// ) { -// // TODO add default value data -// -// with(this / "function" / "f" cast Function::class) { -// parameters.forEach { p -> -// p.name equals "x" -// p.type.constructorFqName.assertNotNull("Parameter type: ") equals "kotlin.String" -// assert(false) { "Add default value data" } -// } -// } -// } -// } + @Test + fun annotatedFunctionWithAnnotationParameters() { + inlineModelTest( + """ + |@Target(AnnotationTarget.VALUE_PARAMETER) + |@Retention(AnnotationRetention.SOURCE) + |@MustBeDocumented + |public annotation class Fancy(val size: Int) + | + |@Fancy(1) fun f() {} + """ + ) { + with((this / "function" / "Fancy").cast()) { + constructors counts 1 + with(constructors.first()) { + parameters counts 1 + with(parameters.first()) { + type.name equals "Int" + name equals "size" + } + } + + with(extra[Annotations].assertNotNull("Annotations")) { + content counts 3 + with(content.map { it.dri.classNames to it }.toMap()) { + with(this["Target"].assertNotNull("Target")) { + params["allowedTargets"].assertNotNull("allowedTargets") equals "[AnnotationTarget.VALUE_PARAMETER]" + } + with(this["Retention"].assertNotNull("Retention")) { + params["value"].assertNotNull("value") equals "(kotlin/annotation/AnnotationRetention, SOURCE)" + } + this["MustBeDocumented"].assertNotNull("MustBeDocumented").params.entries counts 0 + } + } + + } + with((this / "function" / "f").cast()) { + with(this.extra[Annotations].assertNotNull("Annotations")) { + content counts 1 + with(content.first()) { + dri.classNames equals "Fancy" + params.entries counts 1 + params["size"] equals "1" + } + } + } + } + } + + @Test + fun functionWithDefaultParameter() { + inlineModelTest( + """ + |/src/main/kotlin/function/Test.kt + |package function + |fun f(x: String = "") {} + """ + ) { + // TODO add default value data + + with((this / "function" / "f").cast()) { + parameters.forEach { p -> + p.name equals "x" + p.type.name.assertNotNull("Parameter type: ") equals "String" + assert(false) { "No default value data" } + } + } + } + } // @Test fun functionWithDefaultParameter() { // checkSourceExistsAndVerifyModel("testdata/functions/functionWithDefaultParameter.kt", defaultModelConfig) { model -> @@ -302,14 +348,29 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun // } // } // } -// -// @Test fun sinceKotlin() { -// checkSourceExistsAndVerifyModel("testdata/functions/sinceKotlin.kt", defaultModelConfig) { model -> -// with(model.members.single().members.single()) { -// assertEquals("1.1", sinceKotlin) -// } -// } -// } -//} + + @Test + fun sinceKotlin() { + inlineModelTest( + """ + |/** + | * Quite useful [String] + | */ + |@SinceKotlin("1.1") + |fun f(): String = "1.1 rulezz" + """ + ) { + with((this / "function" / "f").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + this.content counts 1 + with(content.first()) { + dri.classNames equals "SinceKotlin" + params.entries counts 1 + params["version"].assertNotNull("version") equals "1.1" + } + } + } + } + } } \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index da128803..e1717fe4 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -5,8 +5,8 @@ import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.transformers.documentables.InheritorsExtractorTransformer import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.model.DInterface -import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.plugability.DokkaPlugin +import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull @@ -83,7 +83,7 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", with(find { it.platformType == Platform.js }.assertNotNull("js key").let { map[it]!! }) { this counts 2 val classes = listOf("B", "C") - assert(all{ classes.contains(it.classNames) }){"One of subclasses missing in js"} + assertTrue(all { classes.contains(it.classNames) }, "One of subclasses missing in js" ) } } diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index c6d111a4..a3fcce42 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -1,8 +1,7 @@ package model +import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.DEnum -import org.jetbrains.dokka.model.DFunction import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import utils.AbstractModelTest @@ -113,7 +112,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { val sups = listOf("Exception", "Cloneable") assertTrue( sups.all { s -> supertypes.map.values.flatten().any { it.classNames == s } }) - "Foo must extend ${sups.joinToString(", ")}" + "Foo must extend ${sups.joinToString(", ")}" } } } @@ -155,7 +154,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { """ ) { with((this / "java" / "Foo").cast()) { - this + throw AssertionError("No type parameters data for class") } } } @@ -286,6 +285,24 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { // } // } + @Test + fun staticMethod() { + inlineModelTest( + """ + |class C { + | public static void foo() {} + |} + """ + ) { + with((this / "java" / "C" / "foo").cast()) { + with(extra[AdditionalModifiers].assertNotNull("AdditionalModifiers")) { + content counts 1 + content.first() equals ExtraModifiers.STATIC + } + } + } + } + // @Test fun staticMethod() { todo // verifyJavaPackageMember("testdata/java/staticMethod.java", defaultModelConfig) { cls -> // val m = cls.members(NodeKind.Function).single { it.name == "foo" } @@ -304,31 +321,53 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { // assertEquals(1, cls.members(NodeKind.Function).size) // } // } - // - // @Test fun annotatedAnnotation() { - // verifyJavaPackageMember("testdata/java/annotatedAnnotation.java", defaultModelConfig) { cls -> - // assertEquals(1, cls.annotations.size) - // with(cls.annotations[0]) { - // assertEquals(1, details.count()) - // with(details[0]) { - // assertEquals(NodeKind.Parameter, kind) - // assertEquals(1, details.count()) - // with(details[0]) { - // assertEquals(NodeKind.Value, kind) - // assertEquals("[AnnotationTarget.FIELD, AnnotationTarget.CLASS, AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]", name) - // } - // } - // } - // } - // } - // + + @Test + fun annotatedAnnotation() { + inlineModelTest( + """ + |import java.lang.annotation.*; + | + |@Target({ElementType.FIELD, ElementType.TYPE, ElementType.METHOD}) + |public @interface Attribute { + | String value() default ""; + |} + """ + ) { + with((this / "java" / "Attribute").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + content counts 1 + with(content.first()) { + dri.classNames equals "Target" + params["value"].assertNotNull("value") equals "PsiArrayInitializerMemberValue:{ElementType.FIELD, ElementType.TYPE, ElementType.METHOD}" + } + } + } + } + } + // @Test fun deprecation() { // verifyJavaPackageMember("testdata/java/deprecation.java", defaultModelConfig) { cls -> // val fn = cls.members(NodeKind.Function).single() // assertEquals("This should no longer be used", fn.deprecation!!.content.toTestString()) // } // } - // + + @Test + fun javaLangObject() { + inlineModelTest( + """ + |class Test { + | public Object fn() { return null; } + |} + """ + ) { + with((this / "java" / "Test" / "fn").cast()) { + type.name equals "Any" + } + } + } + // @Test fun javaLangObject() { // verifyJavaPackageMember("testdata/java/javaLangObject.java", defaultModelConfig) { cls -> // val fn = cls.members(NodeKind.Function).single() @@ -356,6 +395,30 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { } } + @Test + fun inheritorLinks() { + inlineModelTest( + """ + |public class InheritorLinks { + | public static class Foo {} + | + | public static class Bar extends Foo {} + |} + """ + ) { + with((this / "java" / "InheritorLinks").cast()) { + val dri = (this / "Foo").assertNotNull("Foo dri").dri + with((this / "Bar").cast()) { + with(extra[InheritorsInfo].assertNotNull("InheritorsInfo")) { + with(value.map.values.flatten().distinct()) { + this counts 1 + first() equals dri + } + } + } + } + } + } // todo // @Test fun inheritorLinks() { diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index f391df4e..f6f7f3c0 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -1,8 +1,6 @@ package model -import org.jetbrains.dokka.model.KotlinVisibility -import org.jetbrains.dokka.model.DPackage -import org.jetbrains.dokka.model.DProperty +import org.jetbrains.dokka.model.* import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull @@ -140,19 +138,48 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro } } - // todo -// @Test fun sinceKotlin() { -// checkSourceExistsAndVerifyModel("testdata/properties/sinceKotlin.kt", defaultModelConfig) { model -> -// with(model.members.single().members.single()) { -// assertEquals("1.1", sinceKotlin) -// } -// } -// } -//} -// -//class JSPropertyTest: BasePropertyTest(Platform.js) {} -// -//class JVMPropertyTest : BasePropertyTest(Platform.jvm) { + @Test + fun sinceKotlin() { + inlineModelTest( + """ + |/** + | * Quite useful [String] + | */ + |@SinceKotlin("1.1") + |val prop: String = "1.1 rulezz" + """ + ) { + with((this / "property" / "prop").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + this.content counts 1 + with(content.first()) { + dri.classNames equals "SinceKotlin" + params.entries counts 1 + params["version"].assertNotNull("version") equals "1.1" + } + } + } + } + } + + @Test + fun annotatedProperty() { + inlineModelTest( + """ + |@Strictfp var property = "test" + """ + ) { + with((this / "property" / "property").cast()) { + with(extra[Annotations].assertNotNull("Annotations")) { + this.content counts 1 + with(content.first()) { + dri.classNames equals "Strictfp" + params.entries counts 0 + } + } + } + } + } // @Test // fun annotatedProperty() { // checkSourceExistsAndVerifyModel( diff --git a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt index 15dc5581..6ef38aa9 100644 --- a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt +++ b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt @@ -110,13 +110,13 @@ class PageNodeMergerTest : AbstractCoreTest() { val testT = allChildren.filter { it.name == "testT" } val test = allChildren.filter { it.name == "test" } - assert(testT.size == 1) { "There can be only one testT page" } - assert(testT.first().dri.size == 1) { "testT page should have single DRI, but has ${testT.first().dri.size}" } + assertTrue(testT.size == 1) { "There can be only one testT page" } + assertTrue(testT.first().dri.size == 1) { "testT page should have single DRI, but has ${testT.first().dri.size}" } - assert(test.size == 1) { "There can be only one test page" } - assert(test.first().dri.size == 1) { "test page should have single DRI, but has ${test.first().dri.size}" } + assertTrue(test.size == 1) { "There can be only one test page" } + assertTrue(test.first().dri.size == 1) { "test page should have single DRI, but has ${test.first().dri.size}" } - assert(strList.count() == 2) { "Expected 2 warnings, got ${strList.count()}" } + assertTrue(strList.count() == 2) { "Expected 2 warnings, got ${strList.count()}" } } } } diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index 68ab7120..8a3053b3 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -3,6 +3,7 @@ package utils import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Assertions.assertTrue import kotlin.collections.orEmpty @DslMarker @@ -22,6 +23,10 @@ interface AssertDSL { infix fun Any?.equals(other: Any?) = this.assertEqual(other) infix fun Collection?.allEquals(other: Any?) = this?.also { c -> c.forEach { it equals other } } ?: run { assert(false) { "Collection is empty" } } + infix fun Collection?.exists(e: T) { + assertTrue(this.orEmpty().isNotEmpty(), "Collection cannot be null or empty") + assertTrue(this!!.any{it == e}, "Collection doesn't contain $e") + } infix fun Collection?.counts(n: Int) = this.orEmpty().assertCount(n) diff --git a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt index 991ee07d..ce41562b 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt @@ -259,7 +259,7 @@ internal fun ClassId.toDRI(dri: DRI?): DRI = DRI( ) private fun PropertyContainer.mergeAdditionalModifiers(second: Set) = - this[AdditionalModifiers.AdditionalKey]?.squash(AdditionalModifiers(second)) ?: AdditionalModifiers(second) + this[AdditionalModifiers]?.squash(AdditionalModifiers(second)) ?: AdditionalModifiers(second) private fun AdditionalModifiers.squash(second: AdditionalModifiers) = AdditionalModifiers(content + second.content) -- cgit From 037a0f6e86648635011f23f367faad5ab8a95437 Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Fri, 20 Mar 2020 03:45:08 +0100 Subject: Fixing incorrect type parameters test for java classes --- plugins/base/src/test/kotlin/model/JavaTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index a3fcce42..9bbfc929 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -154,7 +154,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { """ ) { with((this / "java" / "Foo").cast()) { - throw AssertionError("No type parameters data for class") + generics counts 1 } } } -- cgit From 7201bcfca3b426d741c10d4c05201cb03e9f5d3c Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Fri, 20 Mar 2020 03:35:03 +0100 Subject: Fixing incorrect java supertypes DRIs --- .../kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 7 ++----- plugins/base/src/test/kotlin/model/JavaTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 549e765f..35bbd05e 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -100,7 +100,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { val superMethods = mutableListOf() methods.forEach { superMethodsKeys.add(it.hash) } fun addAncestors(element: PsiClass) { - ancestorsSet.add(element.toDRI()) + ancestorsSet.add(DRI.from(element)) element.interfaces.forEach(::addAncestors) element.superClass?.let(::addAncestors) } @@ -290,7 +290,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { fun mapBounds(bounds: Array): List = if (bounds.isEmpty()) emptyList() else bounds.mapNotNull { (it as? PsiClassType)?.let { classType -> - Nullable(TypeConstructor(classType.resolve()!!.toDRI(), emptyList())) + Nullable(TypeConstructor(DRI.from(classType.resolve()!!), emptyList())) } } return typeParameters.mapIndexed { index, type -> @@ -304,9 +304,6 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { } } - private fun PsiQualifiedNamedElement.toDRI() = - DRI(qualifiedName.orEmpty().substringBeforeLast('.', ""), name) - private fun PsiMethod.getPropertyNameForFunction() = getAnnotation(DescriptorUtils.JVM_NAME.asString())?.findAttributeValue("name")?.text ?: when { diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 9bbfc929..2545823b 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -407,8 +407,8 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { """ ) { with((this / "java" / "InheritorLinks").cast()) { - val dri = (this / "Foo").assertNotNull("Foo dri").dri - with((this / "Bar").cast()) { + val dri = (this / "Bar").assertNotNull("Foo dri").dri + with((this / "Foo").cast()) { with(extra[InheritorsInfo].assertNotNull("InheritorsInfo")) { with(value.map.values.flatten().distinct()) { this counts 1 -- cgit From af9d525d75a517a5a7cb39d30fd4b2c9e8b93837 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Wed, 25 Mar 2020 15:34:33 +0100 Subject: Fix inproper resolution of annotations --- .../psi/DefaultPsiToDocumentableTranslator.kt | 26 ++++++++++------------ plugins/base/src/test/kotlin/model/JavaTest.kt | 5 ++--- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 91a498bc..74a6a7ea 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -4,13 +4,10 @@ import com.intellij.lang.jvm.JvmModifier import com.intellij.lang.jvm.types.JvmReferenceType import com.intellij.psi.* import com.intellij.psi.impl.source.PsiClassReferenceType -import org.jetbrains.dokka.links.* +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.links.DriOfAny +import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.DAnnotation -import org.jetbrains.dokka.model.DEnum -import org.jetbrains.dokka.model.DFunction -import org.jetbrains.dokka.model.Nullable -import org.jetbrains.dokka.model.TypeConstructor import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext @@ -21,6 +18,7 @@ import org.jetbrains.kotlin.load.java.JvmAbi import org.jetbrains.kotlin.load.java.propertyNameByGetMethodName import org.jetbrains.kotlin.load.java.propertyNamesBySetMethodName import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.psiUtil.getChildOfType import org.jetbrains.kotlin.resolve.DescriptorUtils object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { @@ -291,7 +289,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { if (bounds.isEmpty()) emptyList() else bounds.mapNotNull { (it as? PsiClassType)?.let { classType -> val resolved = classType.resolve()!! - val dri = if(resolved.qualifiedName == "java.lang.Object") DriOfAny + val dri = if (resolved.qualifiedName == "java.lang.Object") DriOfAny else DRI.from(resolved) Nullable(TypeConstructor(dri, emptyList())) } @@ -350,18 +348,18 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { } private fun Collection.toExtra() = mapNotNull { annotation -> - val fqname = annotation.qualifiedName ?: run { - logger.error("No fqName for $annotation!") + val resolved = annotation.getChildOfType()?.resolve() ?: run { + logger.error("$annotation cannot be resolved to symbol!") return@mapNotNull null } Annotations.Annotation( - DRI.from(annotation), - annotation.attributes.mapNotNull { - if (it is PsiNameValuePair) { - it.attributeName to it.value.toString() + DRI.from(resolved), + annotation.attributes.mapNotNull { attr -> + if (attr is PsiNameValuePair) { + attr.value?.text?.let { attr.attributeName to it } } else { - it.attributeName to "" + attr.attributeName to "" } }.toMap() ) diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 2545823b..a0cb68d7 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -336,10 +336,9 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { ) { with((this / "java" / "Attribute").cast()) { with(extra[Annotations].assertNotNull("Annotations")) { - content counts 1 - with(content.first()) { + with(content.single()) { dri.classNames equals "Target" - params["value"].assertNotNull("value") equals "PsiArrayInitializerMemberValue:{ElementType.FIELD, ElementType.TYPE, ElementType.METHOD}" + params["value"].assertNotNull("value") equals "{ElementType.FIELD, ElementType.TYPE, ElementType.METHOD}" } } } -- cgit From 40c3650b2e51d06a10ba204c79ca5c94d390a513 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 25 Mar 2020 15:51:51 +0100 Subject: Introduce VoidObject and JavaObject --- core/src/main/kotlin/model/Documentable.kt | 4 ++-- .../main/kotlin/signatures/KotlinSignatureProvider.kt | 15 ++++++++++++--- .../psi/DefaultPsiToDocumentableTranslator.kt | 18 ++++++++---------- plugins/base/src/test/kotlin/model/JavaTest.kt | 2 +- plugins/base/src/test/kotlin/utils/TestUtils.kt | 2 ++ .../main/kotlin/signatures/JavaSignatureProvider.kt | 6 +++--- 6 files changed, 28 insertions(+), 19 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 0f9e1404..6b41b51e 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -335,8 +335,8 @@ data class Variance(val kind: Kind, val inner: Bound) : Projection() { enum class Kind { In, Out } } data class PrimitiveJavaType(val name: String): Bound() - -val VoidBound = PrimitiveJavaType("void") +object Void : Bound() +object JavaObject : Bound() enum class FunctionModifiers { NONE, FUNCTION, EXTENSION diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index b93be352..c40c5b7c 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.base.signatures import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.links.DriOfAny import org.jetbrains.dokka.links.DriOfUnit import org.jetbrains.dokka.links.sureClassNames import org.jetbrains.dokka.model.* @@ -89,13 +90,19 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog signatureForProjection(it.type) } text(")") - val returnType = f.type - if (!f.isConstructor && returnType is TypeConstructor && returnType.dri != DriOfUnit) { + if (f.documentReturnType()) { text(": ") - signatureForProjection(returnType) + signatureForProjection(f.type) } } + private fun DFunction.documentReturnType() = when { + this.isConstructor -> false + this.type is TypeConstructor && (this.type as TypeConstructor).dri == DriOfUnit -> false + this.type is Void -> false + else -> true + } + private fun signature(t: DTypeParameter) = contentBuilder.contentFor(t) { link(t.name, t.dri) list(t.bounds, prefix = " : ") { @@ -128,6 +135,8 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog text("?") } + is JavaObject -> link("Any", DriOfAny) + is Void -> link("Unit", DriOfUnit) is PrimitiveJavaType -> signatureForProjection(p.translateToKotlin()) } diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 74a6a7ea..218f8c82 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -223,7 +223,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { javadocParser.parseDocumentation(psi).toPlatformDependant(), PsiDocumentableSource(psi).toPlatformDependant(), psi.getVisibility().toPlatformDependant(), - psi.returnType?.let { getBound(type = it) } ?: VoidBound, + psi.returnType?.let { getBound(type = it) } ?: Void, psi.mapTypeParameters(dri), null, psi.getModifier(), @@ -254,14 +254,17 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { is PsiClassReferenceType -> { val resolved: PsiClass = type.resolve() ?: throw IllegalStateException("${type.presentableText} cannot be resolved") - val arguments = type.parameters.map { getProjection(it) } - TypeConstructor(DRI.from(resolved), arguments) + if (resolved.qualifiedName == "java.lang.Object") { + JavaObject + } else { + TypeConstructor(DRI.from(resolved), type.parameters.map { getProjection(it) }) + } } is PsiArrayType -> TypeConstructor( DRI("kotlin", "Array"), listOf(getProjection(type.componentType)) ) - is PsiPrimitiveType -> PrimitiveJavaType(type.name) + is PsiPrimitiveType -> if(type.name == "void") Void else PrimitiveJavaType(type.name) else -> throw IllegalStateException("${type.presentableText} is not supported by PSI parser") } } @@ -287,12 +290,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator { private fun PsiTypeParameterListOwner.mapTypeParameters(dri: DRI): List { fun mapBounds(bounds: Array): List = if (bounds.isEmpty()) emptyList() else bounds.mapNotNull { - (it as? PsiClassType)?.let { classType -> - val resolved = classType.resolve()!! - val dri = if (resolved.qualifiedName == "java.lang.Object") DriOfAny - else DRI.from(resolved) - Nullable(TypeConstructor(dri, emptyList())) - } + (it as? PsiClassType)?.let { classType -> Nullable(getBound(classType)) } } return typeParameters.mapIndexed { index, type -> DTypeParameter( diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index a0cb68d7..b448bf75 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -362,7 +362,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { """ ) { with((this / "java" / "Test" / "fn").cast()) { - type.name equals "Any" + assertTrue(type is JavaObject) } } } diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index 8a3053b3..41c245e6 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -74,4 +74,6 @@ val Bound.name: String? is OtherParameter -> name is PrimitiveJavaType -> name is TypeConstructor -> dri.classNames + is JavaObject -> "Object" + is Void -> "void" } \ No newline at end of file diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 0ec7d0af..6a571660 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -3,11 +3,9 @@ package org.jetbrains.dokka.kotlinAsJava.signatures import org.jetbrains.dokka.base.signatures.SignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder +import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.sureClassNames import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.DAnnotation -import org.jetbrains.dokka.model.DEnum -import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.TextStyle @@ -109,6 +107,8 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge is Nullable -> signatureForProjection(p.inner) + is JavaObject -> link("Object", DRI("java.lang", "Object")) + is Void -> text("void") is PrimitiveJavaType -> text(p.name) } } \ No newline at end of file -- cgit From 7a1956409bc68e8b0ddf47dc9983d2d74728fe7d Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Wed, 25 Mar 2020 15:59:25 +0100 Subject: Fix JavaTest.fileds --- plugins/base/src/test/kotlin/model/JavaTest.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index b448bf75..95185ad3 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -259,14 +259,13 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { children counts 2 with((this / "i").cast()) { - getter.assertNotNull("i.get") - setter.assertNotNull("i.set") + getter equals null + setter equals null } with((this / "s").cast()) { - getter.assertNotNull("s.get") - setter.assertNotNull("s.set") - + getter equals null + setter equals null } } } -- cgit From 83ba2aa4a885bf9ab07ca0402fb8bcf1ca1547ad Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 8 Apr 2020 12:53:32 +0200 Subject: Fix content tests --- plugins/base/src/test/kotlin/expect/ExpectTest.kt | 1 - .../base/src/test/kotlin/model/InheritorsTest.kt | 3 + plugins/base/src/test/kotlin/model/JavaTest.kt | 2 + plugins/base/src/test/kotlin/utils/contentUtils.kt | 1 - .../expect/annotatedFunction/out/html/root/f.html | 12 +- .../annotatedFunction/out/html/root/index.html | 10 +- .../annotatedFunction/out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/-fancy/-init-.html | 12 +- .../out/html/root/-fancy/equals.html | 12 +- .../out/html/root/-fancy/hash-code.html | 12 +- .../out/html/root/-fancy/index.html | 15 +- .../out/html/root/-fancy/to-string.html | 12 +- .../out/html/root/f.html | 12 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../expect/function/out/html/root/fn.html | 14 +- .../expect/function/out/html/root/index.html | 10 +- .../expect/function/out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/-fancy/-init-.html | 12 +- .../out/html/root/-fancy/equals.html | 12 +- .../out/html/root/-fancy/hash-code.html | 12 +- .../out/html/root/-fancy/index.html | 13 +- .../out/html/root/-fancy/to-string.html | 12 +- .../out/html/root/function.html | 12 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/f.html | 12 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/function.html | 12 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/f.html | 12 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../functionWithParams/out/html/root/function.html | 14 +- .../functionWithParams/out/html/root/index.html | 10 +- .../functionWithParams/out/html/styles/style.css | 184 ++++++++++++++------- .../functionWithReceiver/out/html/root/fn.html | 23 +-- .../functionWithReceiver/out/html/root/index.html | 10 +- .../functionWithReceiver/out/html/styles/style.css | 184 ++++++++++++++------- .../genericFunction/out/html/root/generic.html | 14 +- .../genericFunction/out/html/root/index.html | 10 +- .../genericFunction/out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/generic.html | 14 +- .../out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../expect/inlineFunction/out/html/root/f.html | 12 +- .../expect/inlineFunction/out/html/root/index.html | 10 +- .../inlineFunction/out/html/styles/style.css | 184 ++++++++++++++------- .../inlineSuspendFunction/out/html/root/f.html | 12 +- .../inlineSuspendFunction/out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- .../expect/signatureTest/out/html/root/index.html | 7 +- .../out/html/root/signatureTest/index.html | 10 +- .../out/html/root/signatureTest/test.html | 12 +- .../out/html/root/signatureTest/test2.html | 12 +- .../expect/signatureTest/out/html/styles/style.css | 184 ++++++++++++++------- .../out/html/root/available-since1.1.html | 14 +- .../expect/sinceKotlin/out/html/root/index.html | 10 +- .../expect/sinceKotlin/out/html/styles/style.css | 184 ++++++++++++++------- .../expect/suspendFunction/out/html/root/f.html | 12 +- .../suspendFunction/out/html/root/index.html | 10 +- .../suspendFunction/out/html/styles/style.css | 184 ++++++++++++++------- .../suspendInlineFunction/out/html/root/f.html | 12 +- .../suspendInlineFunction/out/html/root/index.html | 10 +- .../out/html/styles/style.css | 184 ++++++++++++++------- 67 files changed, 2353 insertions(+), 1320 deletions(-) (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/plugins/base/src/test/kotlin/expect/ExpectTest.kt b/plugins/base/src/test/kotlin/expect/ExpectTest.kt index 8381c828..e4123256 100644 --- a/plugins/base/src/test/kotlin/expect/ExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/ExpectTest.kt @@ -15,5 +15,4 @@ class ExpectTest : AbstractExpectTest() { fun expectTest() = testDir?.dirsWithFormats(formats).orEmpty().map { (p, f) -> dynamicTest("${p.fileName}-$f") { testOutputWithExcludes(p, f, ignores) } } - } \ No newline at end of file diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index e1717fe4..ee445b5d 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -7,6 +7,7 @@ import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.model.DInterface import org.jetbrains.dokka.plugability.DokkaPlugin import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull @@ -19,6 +20,7 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", } } + @Disabled("reenable after fixing subtypes") @Test fun simple() { inlineModelTest( @@ -38,6 +40,7 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", } } + @Disabled("reenable after fixing subtypes") @Test fun multiplatform() { val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 95185ad3..20543c8f 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -3,6 +3,7 @@ package model import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo import org.jetbrains.dokka.model.* import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull @@ -393,6 +394,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { } } + @Disabled("reenable after fixing subtypes") @Test fun inheritorLinks() { inlineModelTest( diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt index 1e19058a..8742e91a 100644 --- a/plugins/base/src/test/kotlin/utils/contentUtils.kt +++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt @@ -53,7 +53,6 @@ fun ContentMatcherBuilder<*>.signatureWithReceiver( fun ContentMatcherBuilder<*>.pWrapped(text: String) = group {// TODO: remove it when double wrapping for descriptions will be resolved group { +text } - br() } fun ContentMatcherBuilder<*>.unnamedTag(tag: String, content: ContentMatcherBuilder.() -> Unit) = diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html index 724a7e7b..c30acdd1 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f()
-
+
+ +
+

f

+
final fun f()
diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html index c7ec57c7..e30d95d5 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html index 67ed7d8e..731d79da 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/-init-.html @@ -16,13 +16,11 @@ -
//root//Fancy/<init> -
-
JVM
-
-

<init>

-
final fun <init>(size: Int)
-
+
+ +
+

<init>

+
final fun <init>(size: Int)
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html index d07a6e8e..67e41f5c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/equals.html @@ -16,13 +16,11 @@ -
//root//Fancy/equals -
-
JVM
-
-

equals

-
open fun equals(other: Any): Boolean
-
+
+ +
+

equals

+
open fun equals(other: Any): Boolean
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html index 814aa2fb..1ff34399 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/hash-code.html @@ -16,13 +16,11 @@ -
//root//Fancy/hashCode -
-
JVM
-
-

hashCode

-
open fun hashCode(): Int
-
+
+ +
+

hashCode

+
open fun hashCode(): Int
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html index 3fa6cb2b..5cfb39ba 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/index.html @@ -16,14 +16,11 @@ -
//root//Fancy -
-
JVM
-
-

Fancy

-
annotation class Fancy
-
-
+
+ +
+

Fancy

+
annotation class Fancy

Functions

@@ -63,7 +60,7 @@ -
size
+
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html index a9ac04f4..0a116d39 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/-fancy/to-string.html @@ -16,13 +16,11 @@ -
//root//Fancy/toString -
-
JVM
-
-

toString

-
open fun toString(): String
-
+
+ +
+

toString

+
open fun toString(): String
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html index 724a7e7b..c30acdd1 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f()
-
+
+ +
+

f

+
final fun f()
diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html index 1fd01dfe..8384882c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Types

diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/styles/style.css b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/fn.html b/plugins/base/src/test/resources/expect/function/out/html/root/fn.html index eead38c7..a88a7f95 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/fn.html +++ b/plugins/base/src/test/resources/expect/function/out/html/root/fn.html @@ -16,15 +16,13 @@ -
//root//fn -
-
JVM
-
-

fn

-
final fun fn()
-
+
+ +
+

fn

+
final fun fn()

Description

-Function fn
+Function fn
diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/index.html b/plugins/base/src/test/resources/expect/function/out/html/root/index.html index 6c3a7658..950074b0 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/function/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/function/out/html/styles/style.css b/plugins/base/src/test/resources/expect/function/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/function/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html index 66dbcc03..efaf54bf 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/-init-.html @@ -16,13 +16,11 @@ -
//root//Fancy/<init> -
-
JVM
-
-

<init>

-
final fun <init>()
-
+
+ +
+

<init>

+
final fun <init>()
diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html index d07a6e8e..67e41f5c 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/equals.html @@ -16,13 +16,11 @@ -
//root//Fancy/equals -
-
JVM
-
-

equals

-
open fun equals(other: Any): Boolean
-
+
+ +
+

equals

+
open fun equals(other: Any): Boolean
diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html index 814aa2fb..1ff34399 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/hash-code.html @@ -16,13 +16,11 @@ -
//root//Fancy/hashCode -
-
JVM
-
-

hashCode

-
open fun hashCode(): Int
-
+
+ +
+

hashCode

+
open fun hashCode(): Int
diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html index 978a3e56..a80db607 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/index.html @@ -16,14 +16,11 @@ -
//root//Fancy -
-
JVM
-
-

Fancy

-
annotation class Fancy
-
-
+
+ +
+

Fancy

+
annotation class Fancy

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html index a9ac04f4..0a116d39 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/-fancy/to-string.html @@ -16,13 +16,11 @@ -
//root//Fancy/toString -
-
JVM
-
-

toString

-
open fun toString(): String
-
+
+ +
+

toString

+
open fun toString(): String
diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html index 7a5c2f69..c5ee6554 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/function.html @@ -16,13 +16,11 @@ -
//root//function -
-
JVM
-
-

function

-
final fun function(notInlined:
() -> Unit
)
-
+
+ +
+

function

+
final fun function(notInlined:
() -> Unit
)
diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html index fcd48148..f24afac6 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Types

diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html index fb3569a3..7772e1ab 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f(x: String)
-
+
+ +
+

f

+
final fun f(x: String)
diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html index b5d0ffae..e879365f 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html index 7a5c2f69..c5ee6554 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/function.html @@ -16,13 +16,11 @@ -
//root//function -
-
JVM
-
-

function

-
final fun function(notInlined:
() -> Unit
)
-
+
+ +
+

function

+
final fun function(notInlined:
() -> Unit
)
diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html index 78290a98..991ee87c 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html index 724a7e7b..c30acdd1 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f()
-
+
+ +
+

f

+
final fun f()
diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html index c7ec57c7..e30d95d5 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html index 4fa636b2..5ac6c23e 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/function.html @@ -16,15 +16,13 @@ -
//root//function -
-
JVM
-
-

function

-
final fun function(x: Int)
-
+
+ +
+

function

+
final fun function(x: Int)

Description

-MultilineFunction Documentation
+MultilineFunction Documentation
diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html index ce4ab836..bfc1de0c 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithParams/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html index 3924e8cf..8de5b6b8 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/fn.html @@ -16,22 +16,17 @@ -
//root//fn -
-
JVM
-
-

fn

-
final fun String.fn()
-
+
+ +
+

fn

+
final fun String.fn()

Description

-Function with receiver
-
JVM
-
-

fn

-
final fun String.fn(x: Int)
-
+Function with receiver
+

fn

+
final fun String.fn(x: Int)

Description

-Function with receiver
+Function with receiver
diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html index a410bf15..0f91a1dd 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/styles/style.css b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html index 1943ab93..a81357ca 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/generic.html @@ -16,15 +16,13 @@ -
//root//generic -
-
JVM
-
-

generic

-
private final fun <T : Any> generic()
-
+
+ +
+

generic

+
private final fun <T : Any> generic()

Description

-generic function
+generic function
diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html index 98472d45..5fc2d59a 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/genericFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html index 53f9be40..9eeb8831 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/generic.html @@ -16,15 +16,13 @@ -
//root//generic -
-
JVM
-
-

generic

-
final fun <T : R, R : Any> generic()
-
+
+ +
+

generic

+
final fun <T : R, R : Any> generic()

Description

-generic function
+generic function
diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html index 43ed5216..13852519 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/styles/style.css b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html index aca93d48..2344d54b 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f(a:
() -> String
)
-
+
+ +
+

f

+
final fun f(a:
() -> String
)
diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html index d7caa9e7..275bac43 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/inlineFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html index aca93d48..2344d54b 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f(a:
() -> String
)
-
+
+ +
+

f

+
final fun f(a:
() -> String
)
diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html index d7caa9e7..275bac43 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html index db5a5d25..8dded9be 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html @@ -16,8 +16,11 @@ -
//root -

root

+
+ +
+

root

+

Packages

diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html index 7ba3655d..2f75a288 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html @@ -16,12 +16,10 @@ -
//root/signatureTest -
-
JVM
-
-

Package signatureTest

-
+
+ +
+

Package signatureTest

Functions

diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html index 5ab1afb1..6eda8f33 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html @@ -16,13 +16,11 @@ -
//root/signatureTest/test -
-
JVM
-
-

test

-
final fun test(i:
(Int) -> Int
)
-
+
+ +
+

test

+
final fun test(i:
(Int) -> Int
)
diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html index 092e2998..d01ffd73 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html @@ -16,13 +16,11 @@ -
//root/signatureTest/test2 -
-
JVM
-
-

test2

-
final fun test2(i:
Int.(Int) -> Int
)
-
+
+ +
+

test2

+
final fun test2(i:
Int.(Int) -> Int
)
diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/styles/style.css b/plugins/base/src/test/resources/expect/signatureTest/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html index bb25ef76..e3301e8c 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/available-since1.1.html @@ -16,15 +16,13 @@ -
//root//availableSince1.1 -
-
JVM
-
-

availableSince1.1

-
-
+
+ +
+

availableSince1.1

+

Description

-Quite useful String
+Quite useful String
diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html index cc426db3..9577d32b 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/styles/style.css b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html index 724a7e7b..c30acdd1 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f()
-
+
+ +
+

f

+
final fun f()
diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html index c7ec57c7..e30d95d5 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html index aca93d48..2344d54b 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/f.html @@ -16,13 +16,11 @@ -
//root//f -
-
JVM
-
-

f

-
final fun f(a:
() -> String
)
-
+
+ +
+

f

+
final fun f(a:
() -> String
)
diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html index d7caa9e7..275bac43 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html @@ -16,12 +16,10 @@ -
//root/ -
-
JVM
-
-

Package

-
+
+ +
+

Package

Functions

diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/styles/style.css b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/styles/style.css index 80865758..5c347128 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/styles/style.css +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/styles/style.css @@ -13,9 +13,10 @@ } #leftColumn { - padding-left: 12px; + width: 280px; min-height: 100%; - border-right: 2px solid #DADFE6; + border-right: 1px solid #DADFE6; + flex: 0 0 auto; } @media screen and (max-width: 600px) { @@ -29,12 +30,9 @@ } #sideMenu { - padding-top: 12px; - padding-right: 12px; -} - -#sideMenu .sideMenuPart { - padding-left: 1em; + padding-top: 16px; + position: relative; + overflow: auto; } #sideMenu img { @@ -50,12 +48,14 @@ } #logo { - padding: 5px; - background-size: 55% 90%; - border-bottom: 2px solid #DADFE6; + background-size: 125px 26px; + border-bottom: 1px solid #DADFE6; background-repeat: no-repeat; background-image: url(../images/docs_logo.svg); - height: 6vh; + background-origin: content-box; + padding-left: 24px; + padding-top: 24px; + height: 48px; } .monospace, @@ -63,31 +63,76 @@ font-family: monospace; } +.overview > .navButton { + width: 100%; + height: 100%; + align-items: center; + display: flex; + justify-content: flex-end; + padding-right: 24px; +} + .strikethrough { text-decoration: line-through; } .symbol:empty { - padding: 0px; + padding: 0; } + .symbol { - padding: 5px; background-color: #F4F4F4; + align-items: center; + display: flex; + padding: 8px 16px; + box-sizing: border-box; + font-weight: bold; + white-space: pre; +} + +#nav-submenu > .sideMenuPart { + padding-left: 0; /* packages are same level as modules */ } .sideMenuPart > .overview { + height: 40px; width: 100%; - display: inline-flex; + display: flex; + align-items: center; + position: relative; + user-select: none; /* there's a weird bug with text selection */ } -.overview > .navButton { - width: 100%; - display: inline-flex; - justify-content: flex-end; +.sideMenuPart a { + display: flex; + align-items: center; + flex: 1; + height: 100%; + color: #637282; } -.sideMenuPart > .overview:hover { - background-color: rgba(91, 93, 239, 0.15); +.sideMenuPart > .overview:before { + box-sizing: border-box; + content: ''; + top: 0; + width: 200%; + right: 0; + bottom: 0; + position: absolute; + z-index: -1; +} + +.overview:hover:before { + background-color: #DADFE5; +} + +#nav-submenu { + padding-left: 24px; +} + +.sideMenuPart { + padding-left: 12px; + box-sizing: border-box; } .sideMenuPart .hidden > .overview .navButtonContent::before { @@ -121,7 +166,7 @@ body, table { font: 14px/1.5 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F4F4F4; font-weight: 300; - margin-right: auto; + margin: 0; max-width: 1440px; } @@ -134,6 +179,7 @@ table { tbody > tr { border-bottom: 2px solid #F4F4F4; + min-height: 56px; } td:first-child { @@ -149,6 +195,12 @@ td:first-child { .symbol { font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; font-size: 12px; + min-height: 43px; +} + +.symbol > a { + color: #5B5DEF; + text-decoration: underline; } .identifier { @@ -195,8 +247,8 @@ a { } a:hover { - color: inherit; - text-decoration: underline; + color: #282E34; + text-decoration: none; } a small { @@ -343,41 +395,41 @@ footer { } .platform-tag { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; - width: 10px; - height: 10px; - max-width: 10px; - max-height: 10px; - border-radius: 8px; - transition: width 1s, height 1s; - margin-left: 14px; - margin-top: auto; - margin-bottom: auto; - font-family: Inter, Arial, sans-serif; - font-size: 12px; - font-weight: 400; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - text-align: center; - color: #fff + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + width: 10px; + height: 10px; + max-width: 10px; + max-height: 10px; + border-radius: 8px; + transition: width 1s, height 1s; + margin-left: 14px; + margin-top: auto; + margin-bottom: auto; + font-family: Inter, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + text-align: center; + color: #fff } .platform-tagged:hover .platform-tag, -.platform-tagged:hover>.platform-tag { - text-indent: 0; - white-space: nowrap; - padding: 0 7px; - border-radius: 9px; - margin-left: 8px; - width: auto; - height: 15px; - max-width: 500px; - max-height: 500px; - transition: max-width 1s, max-height 1s +.platform-tagged:hover > .platform-tag { + text-indent: 0; + white-space: nowrap; + padding: 0 7px; + border-radius: 9px; + margin-left: 8px; + width: auto; + height: 15px; + max-width: 500px; + max-height: 500px; + transition: max-width 1s, max-height 1s } .platform-tagged { @@ -416,9 +468,23 @@ tr.platform-tagged { color: white; } -.platform-tagged > .content { - display: block; - flex: auto; +td.content { + padding-left: 24px; + padding-top: 16px; + display: flex; + flex-direction: column; +} + +.content > a { + text-decoration: none; + font-style: normal; + font-weight: 600; + font-size: 14px; + color: #282E34; +} + +.content > a:hover { + color: #5B5DEF; } @media print, screen and (max-width: 960px) { -- cgit From 3f2a790190da4f40ea6d8a976aa1929b2a1b002b Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Tue, 5 May 2020 17:45:12 +0200 Subject: Changing approach from platform-driven to source-set-driven --- .idea/compiler.xml | 36 +++ core/src/main/kotlin/DokkaGenerator.kt | 36 +-- core/src/main/kotlin/configuration.kt | 6 +- core/src/main/kotlin/defaultConfiguration.kt | 2 + core/src/main/kotlin/model/Documentable.kt | 168 ++++++-------- core/src/main/kotlin/model/SourceSetData.kt | 23 ++ core/src/main/kotlin/model/aditionalExtras.kt | 4 +- core/src/main/kotlin/model/documentableUtils.kt | 15 +- core/src/main/kotlin/pages/ContentNodes.kt | 29 +-- core/src/main/kotlin/pages/PageNodes.kt | 5 +- core/src/main/kotlin/plugability/DokkaContext.kt | 14 +- .../PreMergeDocumentableTransformer.kt | 2 +- .../sources/SourceToDocumentableTranslator.kt | 4 +- plugins/base/src/main/kotlin/DokkaBase.kt | 6 +- .../src/main/kotlin/renderers/DefaultRenderer.kt | 21 +- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 58 ++--- .../main/kotlin/renderers/html/NavigationPage.kt | 4 +- .../resolvers/local/DefaultLocationProvider.kt | 9 +- .../kotlin/resolvers/local/LocationProvider.kt | 4 +- .../kotlin/signatures/KotlinSignatureProvider.kt | 35 ++- .../documentables/ActualTypealiasAdder.kt | 8 +- .../documentables/DefaultDocumentableMerger.kt | 233 ++++++++----------- .../documentables/DocumentableVisibilityFilter.kt | 55 +++-- .../InheritorsExtractorTransformer.kt | 23 +- .../ModuleAndPackageDocumentationTransformer.kt | 42 ++-- .../pages/comments/CommentsToContentConverter.kt | 3 +- .../pages/comments/DocTagToContentConverter.kt | 33 +-- .../merger/SameMethodNamePageMergerStrategy.kt | 2 +- .../pages/samples/SamplesTransformer.kt | 25 +- .../pages/sourcelinks/SourceLinksTransformer.kt | 23 +- .../DefaultDescriptorToDocumentableTranslator.kt | 252 ++++++++++----------- .../documentables/DefaultPageCreator.kt | 111 +++++---- .../documentables/PageContentBuilder.kt | 98 ++++---- .../psi/DefaultPsiToDocumentableTranslator.kt | 57 +++-- .../src/test/kotlin/expect/AbstractExpectTest.kt | 2 +- .../kotlin/linkableContent/LinkableContentTest.kt | 6 + plugins/base/src/test/kotlin/model/ClassesTest.kt | 20 +- .../base/src/test/kotlin/model/InheritorsTest.kt | 10 +- plugins/base/src/test/kotlin/model/JavaTest.kt | 4 +- plugins/base/src/test/kotlin/model/PackagesTest.kt | 4 +- .../test/kotlin/renderers/RenderingOnlyTestBase.kt | 7 +- .../renderers/html/PlatformDependentHintTest.kt | 120 ---------- .../renderers/html/SourceSetDependentHintTest.kt | 121 ++++++++++ .../annotatedFunction/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../annotatedFunction/out/html/root/index.html | 4 +- .../annotatedFunction/out/html/root/package-list | 4 +- .../annotatedFunction/out/html/scripts/pages.js | 0 .../out/html/navigation.html | 10 +- .../out/html/root/[jvm root]/-fancy/-init-.html | 32 --- .../out/html/root/[jvm root]/-fancy/equals.html | 32 --- .../out/html/root/[jvm root]/-fancy/hash-code.html | 32 --- .../out/html/root/[jvm root]/-fancy/index.html | 102 --------- .../out/html/root/[jvm root]/-fancy/to-string.html | 32 --- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 69 ------ .../out/html/root/[main root]/-fancy/-init-.html | 32 +++ .../out/html/root/[main root]/-fancy/equals.html | 32 +++ .../html/root/[main root]/-fancy/hash-code.html | 32 +++ .../out/html/root/[main root]/-fancy/index.html | 102 +++++++++ .../html/root/[main root]/-fancy/to-string.html | 32 +++ .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 69 ++++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 10 +- .../expect/function/out/html/navigation.html | 6 +- .../function/out/html/root/[jvm root]/fn.html | 34 --- .../function/out/html/root/[jvm root]/index.html | 50 ---- .../function/out/html/root/[main root]/fn.html | 34 +++ .../function/out/html/root/[main root]/index.html | 50 ++++ .../expect/function/out/html/root/index.html | 4 +- .../expect/function/out/html/root/package-list | 4 +- .../out/html/navigation.html | 10 +- .../out/html/root/[jvm root]/-fancy/-init-.html | 32 --- .../out/html/root/[jvm root]/-fancy/equals.html | 32 --- .../out/html/root/[jvm root]/-fancy/hash-code.html | 32 --- .../out/html/root/[jvm root]/-fancy/index.html | 83 ------- .../out/html/root/[jvm root]/-fancy/to-string.html | 32 --- .../out/html/root/[jvm root]/function.html | 32 --- .../out/html/root/[jvm root]/index.html | 69 ------ .../out/html/root/[main root]/-fancy/-init-.html | 32 +++ .../out/html/root/[main root]/-fancy/equals.html | 32 +++ .../html/root/[main root]/-fancy/hash-code.html | 32 +++ .../out/html/root/[main root]/-fancy/index.html | 83 +++++++ .../html/root/[main root]/-fancy/to-string.html | 32 +++ .../out/html/root/[main root]/function.html | 32 +++ .../out/html/root/[main root]/index.html | 69 ++++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 10 +- .../out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- .../out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/function.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/function.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- .../out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- .../functionWithParams/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/function.html | 34 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/function.html | 34 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../functionWithParams/out/html/root/index.html | 4 +- .../functionWithParams/out/html/root/package-list | 4 +- .../functionWithReceiver/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/fn.html | 40 ---- .../out/html/root/[jvm root]/index.html | 66 ------ .../out/html/root/[main root]/fn.html | 40 ++++ .../out/html/root/[main root]/index.html | 66 ++++++ .../functionWithReceiver/out/html/root/index.html | 4 +- .../out/html/root/package-list | 6 +- .../genericFunction/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/generic.html | 34 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/generic.html | 34 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../genericFunction/out/html/root/index.html | 4 +- .../genericFunction/out/html/root/package-list | 4 +- .../out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/generic.html | 34 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/generic.html | 34 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- .../expect/inlineFunction/out/html/navigation.html | 6 +- .../inlineFunction/out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../expect/inlineFunction/out/html/root/index.html | 4 +- .../inlineFunction/out/html/root/package-list | 4 +- .../inlineSuspendFunction/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../inlineSuspendFunction/out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- .../expect/signatureTest/out/html/root/index.html | 2 +- .../out/html/root/signatureTest/index.html | 8 +- .../out/html/root/signatureTest/test.html | 2 +- .../out/html/root/signatureTest/test2.html | 2 +- .../expect/sinceKotlin/out/html/navigation.html | 6 +- .../html/root/[jvm root]/available-since1.1.html | 34 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../html/root/[main root]/available-since1.1.html | 34 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../expect/sinceKotlin/out/html/root/index.html | 4 +- .../expect/sinceKotlin/out/html/root/package-list | 4 +- .../suspendFunction/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../suspendFunction/out/html/root/index.html | 4 +- .../suspendFunction/out/html/root/package-list | 4 +- .../suspendInlineFunction/out/html/navigation.html | 6 +- .../out/html/root/[jvm root]/f.html | 32 --- .../out/html/root/[jvm root]/index.html | 50 ---- .../out/html/root/[main root]/f.html | 32 +++ .../out/html/root/[main root]/index.html | 50 ++++ .../suspendInlineFunction/out/html/root/index.html | 4 +- .../out/html/root/package-list | 4 +- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 11 +- .../kotlin/converters/KotlinToJavaConverter.kt | 86 +++---- .../kotlin/signatures/JavaSignatureProvider.kt | 4 +- runners/cli/src/main/kotlin/cli/main.kt | 11 + .../dokka/gradle/ConfigurationExtractor.kt | 144 ++++++------ .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 47 ++-- .../dokka/gradle/configurationImplementations.kt | 2 + .../main/kotlin/org/jetbrains/dokka/gradle/main.kt | 4 +- .../kotlin/org/jetbrains/dokka/gradle/utils.kt | 14 +- runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 7 +- .../src/main/kotlin/testApi/context/MockContext.kt | 12 +- .../testApi/testRunner/DokkaTestGenerator.kt | 11 +- .../main/kotlin/testApi/testRunner/TestRunner.kt | 10 +- 193 files changed, 3010 insertions(+), 3003 deletions(-) create mode 100644 core/src/main/kotlin/model/SourceSetData.kt delete mode 100644 plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt create mode 100644 plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunction/out/html/scripts/pages.js delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/-init-.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/equals.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/hash-code.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/index.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/to-string.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/-init-.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/equals.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/hash-code.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/index.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/to-string.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/fn.html delete mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/[main root]/fn.html create mode 100644 plugins/base/src/test/resources/expect/function/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/-init-.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/equals.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/hash-code.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/to-string.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/function.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/-init-.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/equals.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/hash-code.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/to-string.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/function.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/function.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/function.html create mode 100644 plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/fn.html delete mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/fn.html create mode 100644 plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/generic.html delete mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/generic.html create mode 100644 plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/generic.html delete mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/generic.html create mode 100644 plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/available-since1.1.html delete mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/available-since1.1.html create mode 100644 plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/index.html delete mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/f.html delete mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/index.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/f.html create mode 100644 plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/index.html (limited to 'plugins/base/src/test/kotlin/model/JavaTest.kt') diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7ee14d19..a7e03ba2 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -16,8 +16,14 @@ + + + + + + @@ -78,14 +84,24 @@ + + + + + + + + + + @@ -101,6 +117,8 @@ + + @@ -110,6 +128,10 @@ + + + + @@ -126,6 +148,8 @@ + + @@ -150,6 +174,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index 053b4cb6..6e62c033 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -1,23 +1,20 @@ package org.jetbrains.dokka -import com.intellij.openapi.vfs.VirtualFileManager -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.DModule -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.common.messages.MessageRenderer import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot import org.jetbrains.kotlin.utils.PathUtil import java.io.File @@ -31,13 +28,14 @@ class DokkaGenerator( ) { fun generate() = timed { report("Setting up analysis environments") - val platforms: Map = setUpAnalysis(configuration) + val sourceSetsCache = SourceSetCache() + val sourceSets: Map = setUpAnalysis(configuration, sourceSetsCache) report("Initializing plugins") - val context = initializePlugins(configuration, logger, platforms) + val context = initializePlugins(configuration, logger, sourceSets, sourceSetsCache) report("Creating documentation models") - val modulesFromPlatforms = createDocumentationModels(platforms, context) + val modulesFromPlatforms = createDocumentationModels(sourceSets, context) report("Transforming documentation model before merging") val transformedDocumentationBeforeMerge = transformDocumentationModelBeforeMerge(modulesFromPlatforms, context) @@ -62,27 +60,31 @@ class DokkaGenerator( logger.report() }.dump("\n\n === TIME MEASUREMENT ===\n") - fun setUpAnalysis(configuration: DokkaConfiguration): Map = + fun setUpAnalysis( + configuration: DokkaConfiguration, + sourceSetsCache: SourceSetCache + ): Map = configuration.passesConfigurations.map { - it.platformData to createEnvironmentAndFacade(it) + sourceSetsCache.getSourceSet(it) to createEnvironmentAndFacade(it) }.toMap() fun initializePlugins( configuration: DokkaConfiguration, logger: DokkaLogger, - platforms: Map, + sourceSets: Map, + sourceSetsCache: SourceSetCache, pluginOverrides: List = emptyList() - ) = DokkaContext.create(configuration, logger, platforms, pluginOverrides) + ) = DokkaContext.create(configuration, logger, sourceSets, sourceSetsCache, pluginOverrides) fun createDocumentationModels( - platforms: Map, + platforms: Map, context: DokkaContext ) = platforms.flatMap { (pdata, _) -> translateSources(pdata, context) } fun transformDocumentationModelBeforeMerge( modulesFromPlatforms: List, context: DokkaContext - ) = context[CoreExtensions.preMergeDocumentableTransformer].fold(modulesFromPlatforms) { acc, t -> t(acc, context) } + ) = context[CoreExtensions.preMergeDocumentableTransformer].fold(modulesFromPlatforms) { acc, t -> t(acc) } fun mergeDocumentationModels( modulesFromPlatforms: List, @@ -119,7 +121,7 @@ class DokkaGenerator( } pass.classpath.forEach { addClasspath(File(it)) } - addSources(pass.sourceRoots.map { it.path }) + addSources((pass.sourceRoots + pass.dependentSourceRoots).map { it.path }) loadLanguageVersionSettings(pass.languageVersion, pass.apiVersion) @@ -128,7 +130,7 @@ class DokkaGenerator( EnvironmentAndFacade(environment, facade) } - private fun translateSources(platformData: PlatformData, context: DokkaContext) = + private fun translateSources(platformData: SourceSetData, context: DokkaContext) = context[CoreExtensions.sourceToDocumentableTranslator].map { it.invoke(platformData, context) } diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 34671c4e..88924924 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka -import org.jetbrains.dokka.pages.PlatformData import java.io.File import java.net.URL @@ -37,8 +36,10 @@ interface DokkaConfiguration { interface PassConfiguration { val moduleName: String + val sourceSetName: String val classpath: List val sourceRoots: List + val dependentSourceRoots: List val samples: List val includes: List val includeNonPublic: Boolean @@ -59,9 +60,6 @@ interface DokkaConfiguration { val analysisPlatform: Platform val targets: List val sinceKotlin: String? - - val platformData: PlatformData - get() = PlatformData(moduleName, analysisPlatform, targets) } interface SourceRoot { diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index ae674ea1..08f70b45 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -16,8 +16,10 @@ data class DokkaConfigurationImpl( data class PassConfigurationImpl ( override val moduleName: String, + override val sourceSetName: String, override val classpath: List, override val sourceRoots: List, + override val dependentSourceRoots: List, override val samples: List, override val includes: List, override val includeNonPublic: Boolean, diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 313f4cd4..85487725 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -1,11 +1,12 @@ package org.jetbrains.dokka.model import com.intellij.psi.PsiNamedElement +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.Platform import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.load.kotlin.toSourceElement @@ -13,8 +14,9 @@ abstract class Documentable { abstract val name: String? abstract val dri: DRI abstract val children: List - abstract val documentation: PlatformDependent - abstract val platformData: List + abstract val documentation: SourceSetDependent + abstract val sourceSets: List + abstract val expectPresentInSet: SourceSetData? override fun toString(): String = "${javaClass.simpleName}($dri)" @@ -25,45 +27,10 @@ abstract class Documentable { override fun hashCode() = dri.hashCode() } -data class PlatformDependent( - val map: Map, - val expect: T? = null -) : Map by map { - val prevalentValue: T? - get() = map.values.distinct().singleOrNull() - - val allValues: Sequence = sequence { - expect?.also { yield(it) } - yieldAll(map.values) - } - - val allEntries: Sequence> = sequence { - expect?.also { yield(null to it) } - map.forEach { (k, v) -> yield(k to v) } - } - - fun getOrExpect(platform: PlatformData): T? = map[platform] ?: expect - - companion object { - fun empty(): PlatformDependent = PlatformDependent(emptyMap()) - - fun from(platformData: PlatformData, element: T) = PlatformDependent(mapOf(platformData to element)) - - @Suppress("UNCHECKED_CAST") - fun from(pairs: Iterable>) = - PlatformDependent( - pairs.filter { it.first != null }.toMap() as Map, - pairs.firstOrNull { it.first == null }?.second - ) - - fun from(vararg pairs: Pair) = from(pairs.asIterable()) - - fun expectFrom(element: T) = PlatformDependent(map = emptyMap(), expect = element) - } -} +typealias SourceSetDependent = Map interface WithExpectActual { - val sources: PlatformDependent + val sources: SourceSetDependent } interface WithScope { @@ -73,7 +40,7 @@ interface WithScope { } interface WithVisibility { - val visibility: PlatformDependent + val visibility: SourceSetDependent } interface WithType { @@ -81,7 +48,7 @@ interface WithType { } interface WithAbstraction { - val modifier: PlatformDependent + val modifier: SourceSetDependent } sealed class Modifier(val name: String) @@ -112,7 +79,7 @@ interface WithGenerics { } interface WithSupertypes { - val supertypes: PlatformDependent> + val supertypes: SourceSetDependent> } interface Callable : WithVisibility, WithType, WithAbstraction, WithExpectActual { @@ -124,8 +91,9 @@ sealed class DClasslike : Documentable(), WithScope, WithVisibility, WithExpectA data class DModule( override val name: String, val packages: List, - override val documentation: PlatformDependent, - override val platformData: List, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData? = null, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithExtraProperties { override val dri: DRI = DRI.topLevel @@ -141,8 +109,9 @@ data class DPackage( override val properties: List, override val classlikes: List, val typealiases: List, - override val documentation: PlatformDependent, - override val platformData: List, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData? = null, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithScope, WithExtraProperties { override val name = dri.packageName.orEmpty() @@ -159,14 +128,15 @@ data class DClass( override val functions: List, override val properties: List, override val classlikes: List, - override val sources: PlatformDependent, - override val visibility: PlatformDependent, + override val sources: SourceSetDependent, + override val visibility: SourceSetDependent, override val companion: DObject?, override val generics: List, - override val supertypes: PlatformDependent>, - override val documentation: PlatformDependent, - override val modifier: PlatformDependent, - override val platformData: List, + override val supertypes: SourceSetDependent>, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val modifier: SourceSetDependent, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, WithExtraProperties { @@ -181,16 +151,17 @@ data class DEnum( override val dri: DRI, override val name: String, val entries: List, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, override val functions: List, override val properties: List, override val classlikes: List, - override val visibility: PlatformDependent, + override val visibility: SourceSetDependent, override val companion: DObject?, override val constructors: List, - override val supertypes: PlatformDependent>, - override val platformData: List, + override val supertypes: SourceSetDependent>, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties { override val children: List @@ -202,11 +173,12 @@ data class DEnum( data class DEnumEntry( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, override val functions: List, override val properties: List, override val classlikes: List, - override val platformData: List, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithScope, WithExtraProperties { override val children: List @@ -220,14 +192,15 @@ data class DFunction( override val name: String, val isConstructor: Boolean, val parameters: List, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, - override val visibility: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, + override val visibility: SourceSetDependent, override val type: Bound, override val generics: List, override val receiver: DParameter?, - override val modifier: PlatformDependent, - override val platformData: List, + override val modifier: SourceSetDependent, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), Callable, WithGenerics, WithExtraProperties { override val children: List @@ -239,16 +212,17 @@ data class DFunction( data class DInterface( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, override val functions: List, override val properties: List, override val classlikes: List, - override val visibility: PlatformDependent, + override val visibility: SourceSetDependent, override val companion: DObject?, override val generics: List, - override val supertypes: PlatformDependent>, - override val platformData: List, + override val supertypes: SourceSetDependent>, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties { override val children: List @@ -260,14 +234,15 @@ data class DInterface( data class DObject( override val name: String?, override val dri: DRI, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, override val functions: List, override val properties: List, override val classlikes: List, - override val visibility: PlatformDependent, - override val supertypes: PlatformDependent>, - override val platformData: List, + override val visibility: SourceSetDependent, + override val supertypes: SourceSetDependent>, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithSupertypes, WithExtraProperties { override val children: List @@ -279,15 +254,16 @@ data class DObject( data class DAnnotation( override val name: String, override val dri: DRI, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, override val functions: List, override val properties: List, override val classlikes: List, - override val visibility: PlatformDependent, + override val visibility: SourceSetDependent, override val companion: DObject?, override val constructors: List, - override val platformData: List, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithExtraProperties { override val children: List @@ -299,15 +275,16 @@ data class DAnnotation( data class DProperty( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent, - override val sources: PlatformDependent, - override val visibility: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent, + override val visibility: SourceSetDependent, override val type: Bound, override val receiver: DParameter?, val setter: DFunction?, val getter: DFunction?, - override val modifier: PlatformDependent, - override val platformData: List, + override val modifier: SourceSetDependent, + override val sourceSets: List, override val generics: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), Callable, WithExtraProperties, WithGenerics { @@ -321,9 +298,10 @@ data class DProperty( data class DParameter( override val dri: DRI, override val name: String?, - override val documentation: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, val type: Bound, - override val platformData: List, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithExtraProperties { override val children: List @@ -335,9 +313,10 @@ data class DParameter( data class DTypeParameter( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, val bounds: List, - override val platformData: List, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithExtraProperties { override val children: List @@ -350,10 +329,11 @@ data class DTypeAlias( override val dri: DRI, override val name: String, override val type: Bound, - val underlyingType: PlatformDependent, - override val visibility: PlatformDependent, - override val documentation: PlatformDependent, - override val platformData: List, + val underlyingType: SourceSetDependent, + override val visibility: SourceSetDependent, + override val documentation: SourceSetDependent, + override val expectPresentInSet: SourceSetData?, + override val sourceSets: List, override val extra: PropertyContainer = PropertyContainer.empty() ) : Documentable(), WithType, WithVisibility, WithExtraProperties { override val children: List @@ -417,7 +397,7 @@ sealed class JavaVisibility(name: String) : Visibility(name) { object Default : JavaVisibility("") } -fun PlatformDependent?.orEmpty(): PlatformDependent = this ?: PlatformDependent.empty() +fun SourceSetDependent?.orEmpty(): SourceSetDependent = this ?: emptyMap() interface DocumentableSource { val path: String @@ -429,4 +409,4 @@ class DescriptorDocumentableSource(val descriptor: DeclarationDescriptor) : Docu class PsiDocumentableSource(val psi: PsiNamedElement) : DocumentableSource { override val path = psi.containingFile.virtualFile.path -} +} \ No newline at end of file diff --git a/core/src/main/kotlin/model/SourceSetData.kt b/core/src/main/kotlin/model/SourceSetData.kt new file mode 100644 index 00000000..8f67f272 --- /dev/null +++ b/core/src/main/kotlin/model/SourceSetData.kt @@ -0,0 +1,23 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.plugability.DokkaContext + +data class SourceSetData( + val moduleName: String, + val sourceSetName: String, + val platform: Platform, + val sourceRoots: List = emptyList() +) + +class SourceSetCache { + private val sourceSets = HashMap() + + fun getSourceSet(pass: DokkaConfiguration.PassConfiguration) = + sourceSets.getOrPut("${pass.moduleName}/${pass.sourceSetName}", + { SourceSetData(pass.moduleName, pass.sourceSetName, pass.analysisPlatform, pass.sourceRoots) } + ) +} + +fun DokkaContext.sourceSet(pass: DokkaConfiguration.PassConfiguration) : SourceSetData = sourceSetCache.getSourceSet(pass) \ No newline at end of file diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index 58209939..27ad8a55 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -41,13 +41,13 @@ object PrimaryConstructorExtra : ExtraProperty, ExtraProperty.Key = this } -data class ActualTypealias(val underlyingType: PlatformDependent) : ExtraProperty { +data class ActualTypealias(val underlyingType: SourceSetDependent) : ExtraProperty { companion object : ExtraProperty.Key { override fun mergeStrategyFor( left: ActualTypealias, right: ActualTypealias ) = - MergeStrategy.Replace(ActualTypealias(PlatformDependent(left.underlyingType + right.underlyingType))) + MergeStrategy.Replace(ActualTypealias(left.underlyingType + right.underlyingType)) } override val key: ExtraProperty.Key = ActualTypealias diff --git a/core/src/main/kotlin/model/documentableUtils.kt b/core/src/main/kotlin/model/documentableUtils.kt index 7f946344..b09260ee 100644 --- a/core/src/main/kotlin/model/documentableUtils.kt +++ b/core/src/main/kotlin/model/documentableUtils.kt @@ -1,21 +1,18 @@ package org.jetbrains.dokka.model -import org.jetbrains.dokka.pages.PlatformData +fun SourceSetDependent.filtered(platformDataList: List) = filter { it.key in platformDataList } +fun SourceSetData?.filtered(platformDataList: List) = takeIf { this in platformDataList } -fun PlatformDependent.filtered(platformDataList: List) = PlatformDependent( - map.filter { it.key in platformDataList }, - expect -) - -fun DTypeParameter.filter(filteredData: List) = - if (filteredData.containsAll(platformData)) this +fun DTypeParameter.filter(filteredData: List) = + if (filteredData.containsAll(sourceSets)) this else { - val intersection = filteredData.intersect(platformData).toList() + val intersection = filteredData.intersect(sourceSets).toList() if (intersection.isEmpty()) null else DTypeParameter( dri, name, documentation.filtered(intersection), + expectPresentInSet?.takeIf { intersection.contains(expectPresentInSet) }, bounds, intersection, extra diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 26bcdf77..bb669199 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -1,6 +1,7 @@ package org.jetbrains.dokka.pages import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties @@ -10,7 +11,7 @@ data class DCI(val dri: Set, val kind: Kind) { interface ContentNode : WithExtraProperties { val dci: DCI - val platforms: Set + val sourceSets: Set val style: Set