diff --git a/lib/src/generator/template_data.dart b/lib/src/generator/template_data.dart index 3c953cda57..4b8b33bf84 100644 --- a/lib/src/generator/template_data.dart +++ b/lib/src/generator/template_data.dart @@ -60,6 +60,10 @@ abstract class TemplateDataBase { return navLinksWithGenerics.last; } + bool get isParentExtension => parent is Extension; + + Extension get parentAsExtension => parent as Extension; + bool get hasHomepage => false; String? get homepage => null; diff --git a/lib/src/generator/templates.aot_renderers_for_html.dart b/lib/src/generator/templates.aot_renderers_for_html.dart index 6c507f2b22..01d80939c7 100644 --- a/lib/src/generator/templates.aot_renderers_for_html.dart +++ b/lib/src/generator/templates.aot_renderers_for_html.dart @@ -758,7 +758,7 @@ String renderExtension(ExtensionTemplateData context0) { if (context2.hasPublicInstanceFields) { buffer.writeln(); buffer.write(''' -
+

Properties

'''); @@ -770,7 +770,7 @@ String renderExtension(ExtensionTemplateData context0) { buffer.writeln(); buffer.write('''
-
'''); +
'''); } buffer.write('\n\n '); buffer.write(_renderExtension_partial_instance_methods_7(context2)); @@ -782,17 +782,18 @@ String renderExtension(ExtensionTemplateData context0) { buffer.write(_renderExtension_partial_static_methods_10(context2)); buffer.write('\n '); buffer.write(_renderExtension_partial_static_constants_11(context2)); + var context6 = context0.extension; buffer.writeln(); buffer.write(''' '''); buffer.writeln(); var context2 = context0.library; buffer.write('\n '); @@ -1190,7 +1192,7 @@ String renderLibrary(LibraryTemplateData context0) { var context4 = context3.library; var context5 = context4.publicClassesSorted; for (var context6 in context5) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_container_5(context6)); } buffer.writeln(); @@ -1210,7 +1212,7 @@ String renderLibrary(LibraryTemplateData context0) { var context8 = context7.library; var context9 = context8.publicEnumsSorted; for (var context10 in context9) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_container_5(context10)); } buffer.writeln(); @@ -1230,7 +1232,7 @@ String renderLibrary(LibraryTemplateData context0) { var context12 = context11.library; var context13 = context12.publicMixinsSorted; for (var context14 in context13) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_container_5(context14)); } buffer.writeln(); @@ -1250,7 +1252,7 @@ String renderLibrary(LibraryTemplateData context0) { var context16 = context15.library; var context17 = context16.publicExtensionTypesSorted; for (var context18 in context17) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_extension_type_6(context18)); } buffer.writeln(); @@ -1270,7 +1272,7 @@ String renderLibrary(LibraryTemplateData context0) { var context20 = context19.library; var context21 = context20.publicExtensionsSorted; for (var context22 in context21) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_extension_7(context22)); } buffer.writeln(); @@ -1290,7 +1292,7 @@ String renderLibrary(LibraryTemplateData context0) { var context24 = context23.library; var context25 = context24.publicConstantsSorted; for (var context26 in context25) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_constant_8(context26)); } buffer.writeln(); @@ -1310,7 +1312,7 @@ String renderLibrary(LibraryTemplateData context0) { var context28 = context27.library; var context29 = context28.publicPropertiesSorted; for (var context30 in context29) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_property_9(context30)); } buffer.writeln(); @@ -1330,7 +1332,7 @@ String renderLibrary(LibraryTemplateData context0) { var context32 = context31.library; var context33 = context32.publicFunctionsSorted; for (var context34 in context33) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_callable_10(context34)); } buffer.writeln(); @@ -1370,7 +1372,7 @@ String renderLibrary(LibraryTemplateData context0) { var context40 = context39.library; var context41 = context40.publicExceptionsSorted; for (var context42 in context41) { - buffer.write('\n '); + buffer.write('\n '); buffer.write(_renderLibrary_partial_container_5(context42)); } buffer.writeln(); @@ -1420,19 +1422,19 @@ String renderMethod(MethodTemplateData context0) { buffer.writeln(); buffer.write(''' -
'''); var context1 = context0.self; buffer.writeln(); buffer.write(''' -
'''); +
'''); buffer.write(_renderMethod_partial_source_link_1(context1)); buffer.write('''

'''); buffer.write(context1.nameWithGenerics); @@ -1465,18 +1467,33 @@ String renderMethod(MethodTemplateData context0) { +

'''); buffer.write(_renderMethod_partial_footer_8(context0)); @@ -1699,13 +1716,28 @@ String renderProperty(PropertyTemplateData context0) { @@ -3717,7 +3749,10 @@ String _deduplicated_lib_templates__extension_html(Extension context0) { } buffer.write('''">'''); buffer.write(context0.linkedName); - buffer.write(''' '''); + buffer.write(''' + on '''); + buffer.write(context0.extendedType.linkedName); + buffer.write('\n '); buffer.write( __deduplicated_lib_templates__extension_html_partial_categorization_0( context0)); diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index f2762f0eb2..d5fa4a1e73 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -13842,6 +13842,13 @@ class _Renderer_TemplateDataBase extends RendererBase { self.renderSimpleVariable(c, remainingNames, 'bool'), getBool: (CT_ c) => c.includeVersion, ), + 'isParentExtension': Property( + getValue: (CT_ c) => c.isParentExtension, + renderVariable: (CT_ c, Property self, + List remainingNames) => + self.renderSimpleVariable(c, remainingNames, 'bool'), + getBool: (CT_ c) => c.isParentExtension, + ), 'layoutTitle': Property( getValue: (CT_ c) => c.layoutTitle, renderVariable: @@ -13945,6 +13952,29 @@ class _Renderer_TemplateDataBase extends RendererBase { parent: r); }, ), + 'parentAsExtension': Property( + getValue: (CT_ c) => c.parentAsExtension, + renderVariable: + (CT_ c, Property self, List remainingNames) { + if (remainingNames.isEmpty) { + return self.getValue(c).toString(); + } + var name = remainingNames.first; + var nextProperty = + _Renderer_Extension.propertyMap().getValue(name); + return nextProperty.renderVariable( + self.getValue(c) as Extension, + nextProperty, + [...remainingNames.skip(1)]); + }, + isNullValue: (CT_ c) => false, + renderValue: (CT_ c, RendererBase r, + List ast, StringSink sink) { + _render_Extension( + c.parentAsExtension, ast, r.template, sink, + parent: r); + }, + ), 'relCanonicalPrefix': Property( getValue: (CT_ c) => c.relCanonicalPrefix, renderVariable: diff --git a/lib/templates/_extension.html b/lib/templates/_extension.html index be99bab449..f0c8a2877d 100644 --- a/lib/templates/_extension.html +++ b/lib/templates/_extension.html @@ -1,5 +1,7 @@
- {{{ linkedName }}} {{ >categorization }} + {{{ linkedName }}} + on {{{ extendedType.linkedName }}} + {{ >categorization }}
{{{ oneLineDoc }}} diff --git a/lib/templates/extension.html b/lib/templates/extension.html index b926e98e2d..3622fa77f2 100644 --- a/lib/templates/extension.html +++ b/lib/templates/extension.html @@ -1,15 +1,15 @@ -{{>head}} +{{ >head }}
- {{#self}} -
{{>source_link}}

{{{nameWithGenerics}}} {{kind}} {{>feature_set}} {{>categorization}}

- {{/self}} + {{ #self }} +
{{ >source_link }}

{{{ nameWithGenerics }}} {{ kind }} {{ >feature_set }} {{ >categorization }}

+ {{ /self }} - {{#extension}} - {{>documentation}} + {{ #extension }} + {{ >documentation }}
on
@@ -24,33 +24,34 @@ {{ >container_annotations }}
- {{#hasPublicInstanceFields}} -
+ {{ #hasPublicInstanceFields }} +

Properties

- {{#publicInstanceFieldsSorted}} - {{>property}} - {{/publicInstanceFieldsSorted}} + {{ #publicInstanceFieldsSorted }} + {{ >property }} + {{ /publicInstanceFieldsSorted }}
-
- {{/hasPublicInstanceFields}} +
+ {{ /hasPublicInstanceFields }} {{ >instance_methods }} {{ >instance_operators }} {{ >static_properties }} {{ >static_methods }} {{ >static_constants }} + {{ #extension }}
-{{>footer}} +{{ >footer }} diff --git a/lib/templates/library.html b/lib/templates/library.html index 7585f4da49..f023ce836f 100644 --- a/lib/templates/library.html +++ b/lib/templates/library.html @@ -1,155 +1,155 @@ -{{>head}} - -
- {{ !-- TODO(srawlins): Add annotations. }} - {{ #self }} -
- {{ >source_link }} -

- {{{ displayName }}} - {{ kind }} {{ >feature_set }} {{ >categorization }} -

-
- {{ /self }} - - {{#library}} - {{>documentation}} - {{/library}} - - {{#library.hasPublicClasses}} +{{ >head }} + +
+ {{ !-- TODO(srawlins): Add annotations. }} + {{ #self }} +
+ {{ >source_link }} +

+ {{{ displayName }}} + {{ kind }} {{ >feature_set }} {{ >categorization }} +

+
+ {{ /self }} + + {{ #library }} + {{ >documentation }} + {{ /library }} + + {{ #library.hasPublicClasses }}

Classes

- {{#library.publicClassesSorted}} - {{>container}} - {{/library.publicClassesSorted}} + {{ #library.publicClassesSorted }} + {{ >container }} + {{ /library.publicClassesSorted }}
- {{/library.hasPublicClasses}} + {{ /library.hasPublicClasses }} - {{#library.hasPublicEnums}} + {{ #library.hasPublicEnums }}

Enums

- {{#library.publicEnumsSorted}} - {{>container}} - {{/library.publicEnumsSorted}} + {{ #library.publicEnumsSorted }} + {{ >container }} + {{ /library.publicEnumsSorted }}
- {{/library.hasPublicEnums}} + {{ /library.hasPublicEnums }} - {{#library.hasPublicMixins}} + {{ #library.hasPublicMixins }}

Mixins

- {{#library.publicMixinsSorted}} - {{>container}} - {{/library.publicMixinsSorted}} + {{ #library.publicMixinsSorted }} + {{ >container }} + {{ /library.publicMixinsSorted }}
- {{/library.hasPublicMixins}} + {{ /library.hasPublicMixins }} - {{ #library.hasPublicExtensionTypes }} + {{ #library.hasPublicExtensionTypes }}

Extension Types

{{ #library.publicExtensionTypesSorted }} - {{ >extension_type }} + {{ >extension_type }} {{ /library.publicExtensionTypesSorted }}
- {{ /library.hasPublicExtensionTypes }} + {{ /library.hasPublicExtensionTypes }} - {{#library.hasPublicExtensions}} + {{ #library.hasPublicExtensions }}

Extensions

- {{#library.publicExtensionsSorted}} - {{>extension}} - {{/library.publicExtensionsSorted}} + {{ #library.publicExtensionsSorted }} + {{ >extension }} + {{ /library.publicExtensionsSorted }}
- {{/library.hasPublicExtensions}} + {{ /library.hasPublicExtensions }} - {{#library.hasPublicConstants}} + {{ #library.hasPublicConstants }}

Constants

- {{#library.publicConstantsSorted}} - {{>constant}} - {{/library.publicConstantsSorted}} + {{ #library.publicConstantsSorted }} + {{ >constant }} + {{ /library.publicConstantsSorted }}
- {{/library.hasPublicConstants}} + {{ /library.hasPublicConstants }} - {{#library.hasPublicProperties}} + {{ #library.hasPublicProperties }}

Properties

- {{#library.publicPropertiesSorted}} - {{>property}} - {{/library.publicPropertiesSorted}} + {{ #library.publicPropertiesSorted }} + {{ >property }} + {{ /library.publicPropertiesSorted }}
- {{/library.hasPublicProperties}} + {{ /library.hasPublicProperties }} - {{#library.hasPublicFunctions}} + {{ #library.hasPublicFunctions }}

Functions

- {{#library.publicFunctionsSorted}} - {{>callable}} - {{/library.publicFunctionsSorted}} + {{ #library.publicFunctionsSorted }} + {{ >callable }} + {{ /library.publicFunctionsSorted }}
- {{/library.hasPublicFunctions}} + {{ /library.hasPublicFunctions }} - {{#library.hasPublicTypedefs}} + {{ #library.hasPublicTypedefs }}

Typedefs

- {{#library.publicTypedefsSorted}} - {{>typedef}} - {{/library.publicTypedefsSorted}} + {{ #library.publicTypedefsSorted }} + {{ >typedef }} + {{ /library.publicTypedefsSorted }}
- {{/library.hasPublicTypedefs}} + {{ /library.hasPublicTypedefs }} - {{#library.hasPublicExceptions}} + {{ #library.hasPublicExceptions }}

Exceptions / Errors

- {{#library.publicExceptionsSorted}} - {{>container}} - {{/library.publicExceptionsSorted}} + {{ #library.publicExceptionsSorted }} + {{ >container }} + {{ /library.publicExceptionsSorted }}
- {{/library.hasPublicExceptions}} + {{ /library.hasPublicExceptions }}
-{{>footer}} +{{ >footer }} diff --git a/lib/templates/method.html b/lib/templates/method.html index 309529d1e0..e15ab5bc28 100644 --- a/lib/templates/method.html +++ b/lib/templates/method.html @@ -1,33 +1,38 @@ -{{>head}} +{{ >head }} -
- {{#self}} -
{{>source_link}}

{{{nameWithGenerics}}} {{fullkind}} {{>feature_set}}

- {{/self}} +
+ {{ #self }} +
{{ >source_link }}

{{{ nameWithGenerics }}} {{ fullkind }} {{ >feature_set }}

+ {{ /self }} - {{#method}} + {{ #method }}
{{ >callable_multiline }} {{ >attributes }}
- {{>documentation}} + {{ >documentation }} - {{>source_code}} + {{ >source_code }} - {{/method}} + {{ /method }}
+
-{{>footer}} +{{ >footer }} diff --git a/lib/templates/property.html b/lib/templates/property.html index 853d755d5f..4377988e36 100644 --- a/lib/templates/property.html +++ b/lib/templates/property.html @@ -35,7 +35,12 @@