Skip to content

Commit

Permalink
rd-gen: support multiline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Dec 12, 2023
1 parent 7b00c64 commit 48a01e9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ open class Cpp17Generator(
private fun PrettyPrinter.docDecl(decl: Declaration) {
if (decl.documentation != null || decl.sourceFileAndLine != null) {
+"/// <summary>"
decl.documentation?.let {
decl.documentation?.lines()?.forEach {
+"/// $it"
}
decl.sourceFileAndLine?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ open class CSharp50Generator(
protected open fun PrettyPrinter.doc(decl: Declaration) {
if (decl.documentation != null || decl.sourceFileAndLine != null) {
+ "/// <summary>"
decl.documentation?.let {
decl.documentation?.lines()?.forEach {
+ "/// $it"
}
decl.sourceFileAndLine?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace org.example

/// <summary>
/// This is a documentation test,
and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:14</p>
/// and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:11</p>
/// </summary>
public class DocumentationModelRoot : RdExtBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

/// <summary>
/// This is a documentation test,
and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:14</p>
/// and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:11</p>
/// </summary>
namespace org.example {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace org.example

/// <summary>
/// This is a documentation test,
and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:14</p>
/// and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:11</p>
/// </summary>
public class DocumentationModelRoot : RdExtBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

/// <summary>
/// This is a documentation test,
and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:14</p>
/// and it is also multiline.
/// <p>Generated from: ModelWithDocumentation.kt:11</p>
/// </summary>
namespace org.example {

Expand Down

0 comments on commit 48a01e9

Please sign in to comment.