Skip to content

Commit 66366cd

Browse files
authored
Tweak templates (#3853)
1 parent 218e8c1 commit 66366cd

File tree

5 files changed

+27
-32
lines changed

5 files changed

+27
-32
lines changed

lib/src/generator/templates.aot_renderers_for_html.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,8 @@ String renderProperty(PropertyTemplateData context0) {
15641564
buffer.write('''</h1></div>''');
15651565
buffer.writeln();
15661566
var context2 = context0.self;
1567-
if (context2.hasNoGetterSetter) {
1567+
buffer.write('\n ');
1568+
if (!context2.hasGetterOrSetter) {
15681569
buffer.writeln();
15691570
buffer.write('''
15701571
<section class="multi-line-signature">
@@ -1584,7 +1585,7 @@ String renderProperty(PropertyTemplateData context0) {
15841585
buffer.write('\n ');
15851586
buffer.write(_renderProperty_partial_source_code_7(context2));
15861587
}
1587-
buffer.writeln();
1588+
buffer.write('\n\n ');
15881589
if (context2.hasGetterOrSetter) {
15891590
if (context2.hasGetter) {
15901591
buffer.write('\n ');
@@ -2102,7 +2103,7 @@ String renderTopLevelProperty(TopLevelPropertyTemplateData context0) {
21022103
buffer.write(_renderTopLevelProperty_partial_categorization_3(context1));
21032104
buffer.write('''</h1></div>
21042105
''');
2105-
if (context1.hasNoGetterSetter) {
2106+
if (!context1.hasGetterOrSetter) {
21062107
buffer.writeln();
21072108
buffer.write('''
21082109
<section class="multi-line-signature">

lib/src/generator/templates.runtime_renderers.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6484,13 +6484,6 @@ class _Renderer_GetterSetterCombo extends RendererBase<GetterSetterCombo> {
64846484
self.renderSimpleVariable(c, remainingNames, 'bool'),
64856485
getBool: (CT_ c) => c.hasGetterOrSetter,
64866486
),
6487-
'hasNoGetterSetter': Property(
6488-
getValue: (CT_ c) => c.hasNoGetterSetter,
6489-
renderVariable: (CT_ c, Property<CT_> self,
6490-
List<String> remainingNames) =>
6491-
self.renderSimpleVariable(c, remainingNames, 'bool'),
6492-
getBool: (CT_ c) => c.hasNoGetterSetter,
6493-
),
64946487
'hasParameters': Property(
64956488
getValue: (CT_ c) => c.hasParameters,
64966489
renderVariable: (CT_ c, Property<CT_> self,
@@ -16010,7 +16003,6 @@ const _invisibleGetters = {
1601016003
'hasExplicitSetter',
1601116004
'hasGetter',
1601216005
'hasGetterOrSetter',
16013-
'hasNoGetterSetter',
1601416006
'hasParameters',
1601516007
'hasPublicGetter',
1601616008
'hasPublicGetterNoSetter',

lib/src/model/getter_setter_combo.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ mixin GetterSetterCombo on ModelElement {
259259

260260
bool get hasGetter => getter != null;
261261

262-
bool get hasNoGetterSetter => !hasGetterOrSetter;
263-
264262
bool get hasGetterOrSetter => hasExplicitGetter || hasExplicitSetter;
265263

266264
bool get hasSetter => setter != null;

lib/templates/property.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
{{ /self }}
1111

1212
{{ #self }}
13-
{{ #hasNoGetterSetter }}
13+
{{!-- If the property has neither an explicit getter nor an explicit setter,
14+
display the "shared" documentation for the combined property. --}}
15+
{{ ^hasGetterOrSetter }}
1416
<section class="multi-line-signature">
1517
{{ >annotations }}
1618
{{{ modelType.linkedName }}}
@@ -19,8 +21,10 @@
1921
</section>
2022
{{ >documentation }}
2123
{{ >source_code }}
22-
{{ /hasNoGetterSetter }}
24+
{{ /hasGetterOrSetter }}
2325

26+
{{!-- Otherwise, the property has an explicit getter or an explicit setter,
27+
or both; display separate docs. --}}
2428
{{ #hasGetterOrSetter }}
2529
{{ #hasGetter }}
2630
{{ >accessor_getter }}

lib/templates/top_level_property.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
{{>head}}
1+
{{ >head }}
22

33
<div
44
id="dartdoc-main-content"
55
class="main-content"
66
data-above-sidebar="{{ aboveSidebarPath }}"
77
data-below-sidebar="{{ belowSidebarPath }}">
8-
{{#self}}
9-
<div>{{>source_link}}<h1><span class="kind-top-level-property">{{{name}}}</span> {{kind}} {{>feature_set}} {{>categorization}}</h1></div>
8+
{{ #self }}
9+
<div>{{ >source_link }}<h1><span class="kind-top-level-property">{{{ name }}}</span> {{ kind }} {{ >feature_set }} {{ >categorization }}</h1></div>
1010

11-
{{#hasNoGetterSetter}}
11+
{{ ^hasGetterOrSetter }}
1212
<section class="multi-line-signature">
1313
{{ >annotations }}
1414
{{{ modelType.linkedName }}}
1515
{{ >name_summary }}
1616
{{ >attributes }}
1717
</section>
18-
{{>documentation}}
19-
{{>source_code}}
20-
{{/hasNoGetterSetter}}
18+
{{ >documentation }}
19+
{{ >source_code }}
20+
{{ /hasGetterOrSetter }}
2121

22-
{{#hasExplicitGetter}}
23-
{{>accessor_getter}}
24-
{{/hasExplicitGetter}}
22+
{{ #hasExplicitGetter }}
23+
{{ >accessor_getter }}
24+
{{ /hasExplicitGetter }}
2525

26-
{{#hasExplicitSetter}}
27-
{{>accessor_setter}}
28-
{{/hasExplicitSetter}}
29-
{{/self}}
26+
{{ #hasExplicitSetter }}
27+
{{ >accessor_setter }}
28+
{{ /hasExplicitSetter }}
29+
{{ /self }}
3030
</div> <!-- /.main-content -->
3131

3232
<div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
33-
{{>search_sidebar}}
34-
<h5>{{parent.name}} {{parent.kind}}</h5>
33+
{{ >search_sidebar }}
34+
<h5>{{ parent.name }} {{ parent.kind }}</h5>
3535
<div id="dartdoc-sidebar-left-content"></div>
3636
</div><!--/.sidebar-offcanvas-left-->
3737

3838
<div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
3939
</div><!--/.sidebar-offcanvas-->
4040

41-
{{>footer}}
41+
{{ >footer }}

0 commit comments

Comments
 (0)