diff --git a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/cpp/Cpp17Generator.kt b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/cpp/Cpp17Generator.kt index 8573d361f..50cd0347e 100644 --- a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/cpp/Cpp17Generator.kt +++ b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/cpp/Cpp17Generator.kt @@ -1084,7 +1084,7 @@ open class Cpp17Generator( private fun PrettyPrinter.docDecl(decl: Declaration) { if (decl.documentation != null || decl.sourceFileAndLine != null) { +"/// " - decl.documentation?.let { + decl.documentation?.lines()?.forEach { +"/// $it" } decl.sourceFileAndLine?.let { diff --git a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/csharp/CSharp50Generator.kt b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/csharp/CSharp50Generator.kt index fcfe75a49..870e1167a 100644 --- a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/csharp/CSharp50Generator.kt +++ b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/csharp/CSharp50Generator.kt @@ -542,7 +542,7 @@ open class CSharp50Generator( protected open fun PrettyPrinter.doc(decl: Declaration) { if (decl.documentation != null || decl.sourceFileAndLine != null) { + "/// " - decl.documentation?.let { + decl.documentation?.lines()?.forEach { + "/// $it" } decl.sourceFileAndLine?.let { diff --git a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt index e120b724a..73549cfd2 100644 --- a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt +++ b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt @@ -459,8 +459,8 @@ open class Kotlin11Generator( protected fun PrettyPrinter.docTrait(decl: Declaration) { if (decl.sourceFileAndLine != null || decl.documentation != null || decl.ownMembers.any { !it.isEncapsulated && it.documentation != null }) { + "/**" - if (decl.documentation != null) { - + " * ${decl.documentation}" + decl.documentation?.lines()?.forEach { + + " * $it" } for (member in decl.ownMembers.filter { !it.isEncapsulated && it.documentation != null }) { + " * @property ${member.name} ${member.documentation}" diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs index 9af59a884..ef926ee37 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs @@ -37,8 +37,8 @@ namespace org.example /// /// This is a documentation test, - and it is also multiline. - ///

Generated from: ModelWithDocumentation.kt:14

+ /// and it is also multiline. + ///

Generated from: ModelWithDocumentation.kt:11

///
public class DocumentationModelRoot : RdExtBase { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt index 1ebded810..eb5b50b3c 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt @@ -17,8 +17,8 @@ import kotlin.jvm.JvmStatic /** * This is a documentation test, -and it is also multiline. - * #### Generated from [ModelWithDocumentation.kt:14] + * and it is also multiline. + * #### Generated from [ModelWithDocumentation.kt:11] */ class DocumentationModelRoot private constructor( ) : RdExtBase() { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h index 27576d123..116413f53 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h @@ -57,8 +57,8 @@ /// /// This is a documentation test, -and it is also multiline. -///

Generated from: ModelWithDocumentation.kt:14

+/// and it is also multiline. +///

Generated from: ModelWithDocumentation.kt:11

///
namespace org.example { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs index 9af59a884..ef926ee37 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs @@ -37,8 +37,8 @@ namespace org.example /// /// This is a documentation test, - and it is also multiline. - ///

Generated from: ModelWithDocumentation.kt:14

+ /// and it is also multiline. + ///

Generated from: ModelWithDocumentation.kt:11

///
public class DocumentationModelRoot : RdExtBase { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt index 1ebded810..eb5b50b3c 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt @@ -17,8 +17,8 @@ import kotlin.jvm.JvmStatic /** * This is a documentation test, -and it is also multiline. - * #### Generated from [ModelWithDocumentation.kt:14] + * and it is also multiline. + * #### Generated from [ModelWithDocumentation.kt:11] */ class DocumentationModelRoot private constructor( ) : RdExtBase() { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h index 27576d123..116413f53 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h @@ -57,8 +57,8 @@ /// /// This is a documentation test, -and it is also multiline. -///

Generated from: ModelWithDocumentation.kt:14

+/// and it is also multiline. +///

Generated from: ModelWithDocumentation.kt:11

///
namespace org.example {