Skip to content

Commit

Permalink
Fix Dart doc (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian authored Jan 5, 2024
1 parent 27e3aa6 commit 76d58a2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion example/dart/lib/src/lib.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion feature_tests/dart/lib/src/lib.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions tool/templates/dart/base.dart.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

{% for directive in directives -%}
{{directive}}
{% endfor -%}

{% endfor %}
{{ body }}

{%- for helper_class in helper_classes.values() %}

{% for helper_class in helper_classes.values() -%}
{%- if !loop.first %}
{% endif -%}
{{helper_class}}

{%- endfor %}

{% endfor -%}
4 changes: 2 additions & 2 deletions tool/templates/dart/enum.dart.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- if !docs.is_empty() %}
{% if !docs.is_empty() -%}
/// {{docs}}
{%- endif %}
{% endif -%}
enum {{type_name}} {
{%- for enum_variant in ty.variants %}
{% if !enum_variant.docs.is_empty() -%}
Expand Down
1 change: 0 additions & 1 deletion tool/templates/dart/init.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/// A [Rune] is a Unicode code point, such as `a`, or `💡`.
///
/// The recommended way to obtain a [Rune] is to create it from a
Expand Down
4 changes: 2 additions & 2 deletions tool/templates/dart/opaque.dart.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- if !docs.is_empty() %}
{% if !docs.is_empty() -%}
/// {{docs}}
{%- endif %}
{% endif -%}
final class {{type_name}} implements ffi.Finalizable {
final ffi.Pointer<ffi.Opaque> _underlying;

Expand Down
6 changes: 3 additions & 3 deletions tool/templates/dart/struct.dart.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{%- if !docs.is_empty() %}
/// {{docs}}
{%- endif %}
final class _{{type_name}}Ffi extends ffi.Struct {
{%- for field in fields %}
{%- match field.annotation %}
Expand All @@ -12,6 +9,9 @@ final class _{{type_name}}Ffi extends ffi.Struct {
{%- endfor %}
}

{% if !docs.is_empty() -%}
/// {{docs}}
{% endif -%}
final class {{type_name}} {
final _{{type_name}}Ffi _underlying;

Expand Down

0 comments on commit 76d58a2

Please sign in to comment.