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 9e3c0fb commit ecca9dc
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 ecca9dc

Please sign in to comment.