From b1902db0cb5adfbe681cb07b84ab5bd1366b0d1f Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Sat, 25 Aug 2018 15:44:56 +0100 Subject: [PATCH] build(docs-infra): render all overloads if they are abstract (#25670) In an overloaded method, the overload with the function body is the actual method doc, and this doc is not included in the list of "additional" overloads. Moreover, the logic (all in dgeni-packages) is that if none of the items has a body then we use the first overload as the actual method doc. In the case of abstract methods, none of the methods have a body. So we have a situation where the overloads collection does not contain the first abstract method, even though it is not the "implementation" of the method. Therefore we need to still render it. Closes #25610 PR Close #25670 --- .../templates/api/lib/memberHelpers.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/aio/tools/transforms/templates/api/lib/memberHelpers.html b/aio/tools/transforms/templates/api/lib/memberHelpers.html index 0a8fca6a07..08134a6499 100644 --- a/aio/tools/transforms/templates/api/lib/memberHelpers.html +++ b/aio/tools/transforms/templates/api/lib/memberHelpers.html @@ -47,6 +47,11 @@ {$ renderMemberSyntax(overload) $} +{% if overload.deprecated !== undefined %} +
+ {$ ('**Deprecated** ' + overload.deprecated) | marked $} +
{% endif %} +

Parameters

{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $} @@ -97,6 +102,13 @@ {% elseif method.overloads.length < 3 -%} + {% if method.isAbstract %} + + + {$ renderOverloadInfo(method, cssClass + '-overload', method) $} + + + {% endif %} {% for overload in method.overloads -%} @@ -110,7 +122,11 @@

{$ method.overloads.length $} overloads...

- {% for overload in method.overloads %} + {% if method.isAbstract %} + {$ renderOverloadInfo(method, cssClass + '-overload', method) $} +
+ {% endif %} + {% for overload in method.overloads %} {$ renderOverloadInfo(overload, cssClass + '-overload', method) $} {% if not loop.last %}
{% endif %} {% endfor %}