mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.03k stars 497 forks source link

Incorrect Doxygen Paragraphs #1806

Open ds5678 opened 6 months ago

ds5678 commented 6 months ago
Brief Description

Doxygen permits word wrap for paragraphs, but CppSharp treats each line as its own paragraph.

OS: Windows

Used headers
/** Line 1
 *  Line 2
 *  Line 3
 *
 *  Line 4
 *  Line 5
 *
 *  Line 6 */
Used settings
DriverOptions options = driver.Options;
options.GeneratorKind = GeneratorKind.CSharp;
Expected
/// <summary>Line 1 Line 2 Line 3</summary>
/// <remarks>
/// <para>Line 4 Line 5</para>
/// <para>Line 6</para>
/// </remarks>

or

/// <summary>
/// Line 1
/// Line 2
/// Line 3
/// </summary>
/// <remarks>
/// <para>
/// Line 4
/// Line 5
/// </para>
/// <para>Line 6</para>
/// </remarks>
Actual
/// <summary>
/// <para>Line 1</para>
/// <para>Line 2</para>
/// <para>Line 3</para>
/// </summary>
/// <remarks>
/// <para>Line 4</para>
/// <para>Line 5</para>
/// <para>Line 6</para>
/// </remarks>
tritao commented 6 months ago

The comment printing code is here: https://github.com/mono/CppSharp/blob/main/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs

It would be insightful to check first how the data ends up in the AST first (as returned by Clang) and then how it gets transformed in that file.