Skip to content

Commit

Permalink
Fix xml doc generation for fields in a record (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Arnott <andrewarnott@live.com>
  • Loading branch information
AArnott authored Sep 2, 2024
1 parent eae12c2 commit f119684
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bindgen/templates/RecordTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
{%- let (ordered_fields, is_reordered) = rec.fields()|order_fields %}

{%- call cs::docstring(rec, 0) %}
{%- for field in ordered_fields %}
{%- match field.docstring() %}
{%- when Some with(docstring) %}
/// <param name="{{ field.name() }}">
{%- let docstring = textwrap::dedent(docstring) %}
{%- for line in docstring.lines() %}
/// {{ line.trim_end() }}
{%- endfor %}
/// </param>
{%- else %}
{%- endmatch %}
{%- endfor %}
{%- let (ordered_fields, is_reordered) = rec.fields()|order_fields %}
{%- if is_reordered %}
/// <remarks>
/// <b>UniFFI Warning:</b> Optional parameters have been reordered because
Expand All @@ -15,7 +28,6 @@
{%- endif %}
{{ config.access_modifier() }} record {{ type_name }} (
{%- for field in ordered_fields %}
{%- call cs::docstring(field, 4) %}
{{ field|type_name }} {{ field.name()|var_name -}}
{%- match field.default_value() %}
{%- when Some with(literal) %} = {{ literal|render_literal(field) }}
Expand Down

0 comments on commit f119684

Please sign in to comment.