aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src')
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt8
-rw-r--r--plugins/base/src/test/kotlin/model/ClassesTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/model/JavaTest.kt1
5 files changed, 8 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index ffceaaa7..526db8e7 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -375,7 +375,7 @@ private class DokkaDescriptorVisitor(
return DFunction(
dri = dri,
- name = "<init>",
+ name = descriptor.constructedClass.name.toString(),
isConstructor = true,
receiver = descriptor.extensionReceiverParameter?.let {
visitReceiverParameterDescriptor(it, DRIWithPlatformInfo(dri, actual))
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 6f980383..df5d4ee1 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -277,7 +277,7 @@ class DefaultPsiToDocumentableTranslator(
val docs = javadocParser.parseDocumentation(psi)
return DFunction(
dri,
- if (isConstructor) "<init>" else psi.name,
+ psi.name,
isConstructor,
psi.parameterList.parameters.map { psiParameter ->
DParameter(
diff --git a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
index 7de48664..90a38055 100644
--- a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
+++ b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
@@ -174,13 +174,13 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
header { +"Constructors" }
table {
group {
- link { +"<init>" }
+ link { +"SomeClass" }
functionSignature(
annotations = emptyMap(),
visibility = "",
modifier = "",
keywords = emptySet(),
- name = "<init>"
+ name = "SomeClass"
)
}
}
@@ -226,7 +226,7 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
header { +"Constructors" }
table {
group {
- link { +"<init>" }
+ link { +"SomeClass" }
platformHinted {
group {
group {
@@ -235,7 +235,7 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
}
group {
+"fun"
- link { +"<init>" }
+ link { +"SomeClass" }
+"(a:"
group {
link { +"String" }
diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt
index 5dc8812e..1bf55235 100644
--- a/plugins/base/src/test/kotlin/model/ClassesTest.kt
+++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt
@@ -332,7 +332,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class
name equals "C"
constructors counts 2
- constructors.map { it.name } allEquals "<init>"
+ constructors.map { it.name } allEquals "C"
with(constructors.find { it.parameters.isNullOrEmpty() } notNull "C()") {
parameters counts 0
diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt
index 1f042304..237131d3 100644
--- a/plugins/base/src/test/kotlin/model/JavaTest.kt
+++ b/plugins/base/src/test/kotlin/model/JavaTest.kt
@@ -161,6 +161,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") {
name equals "Test"
constructors counts 2
+ constructors.forEach { it.name equals "Test" }
constructors.find { it.parameters.isNullOrEmpty() }.assertNotNull("Test()")
with(constructors.find { it.parameters.isNotEmpty() }.assertNotNull("Test(String)")) {