diff options
3 files changed, 65 insertions, 13 deletions
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 31d977a0..69ebce06 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -3,18 +3,9 @@ <JetCodeStyleSettings> <option name="PACKAGES_TO_USE_STAR_IMPORTS"> <value> - <package name="java.util" alias="false" withSubpackages="false" /> - <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" /> - <package name="io.ktor" alias="false" withSubpackages="true" /> - </value> - </option> - <option name="PACKAGES_IMPORT_LAYOUT"> - <value> - <package name="" alias="false" withSubpackages="true" /> - <package name="java" alias="false" withSubpackages="true" /> - <package name="javax" alias="false" withSubpackages="true" /> - <package name="kotlin" alias="false" withSubpackages="true" /> - <package name="" alias="true" withSubpackages="true" /> + <package name="java.util" withSubpackages="false" static="false" /> + <package name="kotlinx.android.synthetic" withSubpackages="true" static="false" /> + <package name="io.ktor" withSubpackages="true" static="false" /> </value> </option> <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 19df2515..40283d82 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -197,7 +197,7 @@ open class DefaultPageCreator( "Constructors", 2, ContentKind.Constructors, - c.constructors.filter { it.extra[PrimaryConstructorExtra] == null }, + c.constructors.filter { it.extra[PrimaryConstructorExtra] == null || it.documentation.isNotEmpty() }, c.sourceSets, extra = PropertyContainer.empty<ContentNode>() + SimpleAttr.header("Constructors") ) { diff --git a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt index c2fbd26f..7de48664 100644 --- a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt @@ -190,4 +190,65 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { } } } + + @Test + fun `class with explicitly documented constructor`() { + testInline( + """ + |/src/main/kotlin/test/source.kt + |package test + | + | /** + | * some comment + | * @constructor ctor comment + | **/ + |class SomeClass(a: String) + """.trimIndent(), testConfiguration + ) { + pagesTransformationStage = { module -> + val page = module.children.single { it.name == "test" } + .children.single { it.name == "SomeClass" } as ContentPage + page.content.assertNode { + group { + header(1) { +"SomeClass" } + platformHinted { + skipAllNotMatching() + group { + +"class" + link { +"SomeClass" } + +"(a:" + group { link { +"String" } } + +")" + } + } + } + group { + header { +"Constructors" } + table { + group { + link { +"<init>" } + platformHinted { + group { + group { + +"ctor comment" + } + } + group { + +"fun" + link { +"<init>" } + +"(a:" + group { + link { +"String" } + } + +")" + } + } + } + } + skipAllNotMatching() + } + } + } + } + } } |