Skip to content

Commit 057d0ed

Browse files
authored
Mark Attribute.name as visibleForOverriding (#3726)
1 parent 67f72d5 commit 057d0ed

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

lib/src/generator/templates.runtime_renderers.dart

-21
Original file line numberDiff line numberDiff line change
@@ -601,27 +601,6 @@ class _Renderer_Attribute extends RendererBase<Attribute> {
601601
parent: r);
602602
},
603603
),
604-
'name': Property(
605-
getValue: (CT_ c) => c.name,
606-
renderVariable:
607-
(CT_ c, Property<CT_> self, List<String> remainingNames) {
608-
if (remainingNames.isEmpty) {
609-
return self.getValue(c).toString();
610-
}
611-
var name = remainingNames.first;
612-
var nextProperty =
613-
_Renderer_String.propertyMap().getValue(name);
614-
return nextProperty.renderVariable(
615-
self.getValue(c) as String,
616-
nextProperty,
617-
[...remainingNames.skip(1)]);
618-
},
619-
isNullValue: (CT_ c) => false,
620-
renderValue: (CT_ c, RendererBase<CT_> r,
621-
List<MustachioNode> ast, StringSink sink) {
622-
_render_String(c.name, ast, r.template, sink, parent: r);
623-
},
624-
),
625604
'sortGroup': Property(
626605
getValue: (CT_ c) => c.sortGroup,
627606
renderVariable: (CT_ c, Property<CT_> self,

lib/src/model/attribute.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44

55
import 'package:collection/collection.dart';
66
import 'package:dartdoc/src/model/privacy.dart';
7+
import 'package:meta/meta.dart';
78

89
int byAttributeOrdering(Attribute a, Attribute b) {
910
if (a.sortGroup < b.sortGroup) return -1;
1011
if (a.sortGroup > b.sortGroup) return 1;
1112
return compareAsciiLowerCaseNatural(a.name, b.name);
1213
}
1314

14-
/// An attribute includes both explicit annotations in code (e.g. `deprecated`)
15-
/// as well as others added by the documentation system (`read-write`).
15+
/// An attribute on an element.
16+
///
17+
/// These include both explicit annotations in code (e.g. `deprecated`) as well
18+
/// as others added by the documentation system (e.g. 'no setter').
1619
abstract class Attribute implements Privacy {
20+
// A name, only used for sorting.
21+
@visibleForOverriding
1722
final String name;
1823

1924
/// Numerical sort group for this attribute.

0 commit comments

Comments
 (0)