diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index facb2e42..a6085801 100644 --- a/src/Generator.Tests/AST/TestAST.cs +++ b/src/Generator.Tests/AST/TestAST.cs @@ -418,6 +418,21 @@ namespace CppSharp.Generator.Tests.AST /// This function implies that a future call to SBTarget::Attach(...) /// will be synchronous. /// ".Replace("\r", string.Empty), commentMethodDoxygen.Replace("\r", string.Empty)); + + var methodDoxygenCustomTags = @class.Methods.First(m => m.Name == "glfwDestroyWindow"); + var commentMethodDoxygenCustomTag = methodDoxygenCustomTags.Comment.FullComment.CommentToString(CommentKind.BCPLSlash); + Assert.AreEqual(@"/// Destroys the specified window and its context. +/// The window to destroy. +/// +/// This function destroys the specified window and its context. On calling +/// this function, no further callbacks will be called for that window. +/// If the context of the specified window is current on the main thread, it is +/// detached before being destroyed. +/// The context of the specified window must not be current on any other +/// thread when this function is called. +/// This function must not be called from a callback. +/// Added in version 3.0. Replaces `glfwCloseWindow`. +/// ".Replace("\r", string.Empty), commentMethodDoxygenCustomTag.Replace("\r", string.Empty)); } [Test] diff --git a/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs b/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs index 38b713d9..c5318a8b 100644 --- a/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs @@ -29,12 +29,33 @@ namespace CppSharp.Generators.CSharp break; case DocumentationCommentKind.BlockCommandComment: var blockCommandComment = (BlockCommandComment) comment; - if (blockCommandComment.CommandKind == CommentCommandKind.Return && - blockCommandComment.ParagraphComment != null) + if (blockCommandComment.ParagraphComment == null) + break; + switch (blockCommandComment.CommandKind) { - sections.Add(new Section(CommentElement.Returns)); - blockCommandComment.ParagraphComment.GetCommentSections(sections); + case CommentCommandKind.Brief: + blockCommandComment.ParagraphComment.GetCommentSections(sections); + break; + case CommentCommandKind.Return: + sections.Add(new Section(CommentElement.Returns)); + blockCommandComment.ParagraphComment.GetCommentSections(sections); + break; + case CommentCommandKind.Since: + var lastBlockSection = sections.Last(); + foreach (var inlineContentComment in blockCommandComment.ParagraphComment.Content) + { + inlineContentComment.GetCommentSections(sections); + if (inlineContentComment.HasTrailingNewline) + lastBlockSection.NewLine(); + } + break; + default: + sections.Add(new Section(CommentElement.Remarks)); + blockCommandComment.ParagraphComment.GetCommentSections(sections); + break; } + + break; case DocumentationCommentKind.ParamCommandComment: var paramCommandComment = (ParamCommandComment) comment; diff --git a/tests/Native/AST.h b/tests/Native/AST.h index c24d3222..cf74fd31 100644 --- a/tests/Native/AST.h +++ b/tests/Native/AST.h @@ -168,6 +168,25 @@ public: /// If \b true, then wait for the next process whose name matches. //------------------------------------------------------------------ int SBAttachInfo(const char *path, bool wait_for); + + /*! @brief Destroys the specified window and its context. + * + * This function destroys the specified window and its context. On calling + * this function, no further callbacks will be called for that window. + * + * If the context of the specified window is current on the main thread, it is + * detached before being destroyed. + * + * @param[in] window The window to destroy. + * + * @note The context of the specified window must not be current on any other + * thread when this function is called. + * + * @reentrancy This function must not be called from a callback. + * + * @since Added in version 3.0. Replaces `glfwCloseWindow`. + */ + void glfwDestroyWindow(int* window); }; template