Skip to content

Commit c08af84

Browse files
committed
fix: centralize the addition of the (optional) semicolon in our code snippets
1 parent e2fcd45 commit c08af84

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
final;` is ill-formed (`final` can't be used on a non-defining
2525
declaration). Similarly, don't show a semicolon if there are base
2626
classes. --}}
27-
{{~#unless (or isSeeBelow isFinal bases)}};{{/unless~}}
28-
{{~#isSeeBelow}} { /* see-below */ };{{/isSeeBelow~}}
27+
{{~#isSeeBelow}} { /* see-below */ }{{/isSeeBelow~}}
28+
{{#if (or isSeeBelow (and (not isFinal) (isEmpty bases)))}};{{/if}}

src/lib/Support/Handlebars.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3793,6 +3793,16 @@ block_helper_missing_fn(
37933793
return {};
37943794
}
37953795

3796+
Expected<dom::Value>
3797+
is_empty_fn(dom::Array const& arguments)
3798+
{
3799+
if (arguments.size() != 2) {
3800+
return Unexpected(Error("isEmpty requires exactly one argument"));
3801+
}
3802+
3803+
return dom::Value(isEmpty(arguments.get(0)));
3804+
}
3805+
37963806
void
37973807
registerBuiltinHelpers(Handlebars& hbs)
37983808
{
@@ -3804,6 +3814,7 @@ registerBuiltinHelpers(Handlebars& hbs)
38043814
hbs.registerHelper("log", dom::makeVariadicInvocable(log_fn));
38053815
hbs.registerHelper("helperMissing", dom::makeVariadicInvocable(helper_missing_fn));
38063816
hbs.registerHelper("blockHelperMissing", dom::makeInvocable(block_helper_missing_fn));
3817+
hbs.registerHelper("isEmpty", dom::makeVariadicInvocable(is_empty_fn));
38073818
}
38083819

38093820
void

0 commit comments

Comments
 (0)