Browse Source

Printed the text from unsupported comment tags. (#911)

pull/912/head
Kimon Topouzidis 8 years ago committed by Dimitar Dobrev
parent
commit
93f5b89b52
  1. 15
      src/Generator.Tests/AST/TestAST.cs
  2. 25
      src/Generator/Generators/CSharp/CSharpCommentPrinter.cs
  3. 19
      tests/Native/AST.h

15
src/Generator.Tests/AST/TestAST.cs

@ -418,6 +418,21 @@ namespace CppSharp.Generator.Tests.AST @@ -418,6 +418,21 @@ namespace CppSharp.Generator.Tests.AST
/// <para>This function implies that a future call to SBTarget::Attach(...)</para>
/// <para>will be synchronous.</para>
/// </remarks>".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(@"/// <summary>Destroys the specified window and its context.</summary>
/// <param name=""window"">The window to destroy.</param>
/// <remarks>
/// <para>This function destroys the specified window and its context. On calling</para>
/// <para>this function, no further callbacks will be called for that window.</para>
/// <para>If the context of the specified window is current on the main thread, it is</para>
/// <para>detached before being destroyed.</para>
/// <para>The context of the specified window must not be current on any other</para>
/// <para>thread when this function is called.</para>
/// <para>This function must not be called from a callback.</para>
/// <para>Added in version 3.0. Replaces `glfwCloseWindow`.</para>
/// </remarks>".Replace("\r", string.Empty), commentMethodDoxygenCustomTag.Replace("\r", string.Empty));
}
[Test]

25
src/Generator/Generators/CSharp/CSharpCommentPrinter.cs

@ -29,12 +29,33 @@ namespace CppSharp.Generators.CSharp @@ -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)
{
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;

19
tests/Native/AST.h

@ -168,6 +168,25 @@ public: @@ -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 <typename T>

Loading…
Cancel
Save