From 057d0ed83e12302532c8d3fabae93469f175a401 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Mon, 18 Mar 2024 15:24:18 -0700 Subject: [PATCH] Mark Attribute.name as visibleForOverriding (#3726) --- .../templates.runtime_renderers.dart | 21 ------------------- lib/src/model/attribute.dart | 9 ++++++-- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index 3be1bb6ce4..8e10f949da 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -601,27 +601,6 @@ class _Renderer_Attribute extends RendererBase { parent: r); }, ), - 'name': Property( - getValue: (CT_ c) => c.name, - renderVariable: - (CT_ c, Property self, List remainingNames) { - if (remainingNames.isEmpty) { - return self.getValue(c).toString(); - } - var name = remainingNames.first; - var nextProperty = - _Renderer_String.propertyMap().getValue(name); - return nextProperty.renderVariable( - self.getValue(c) as String, - nextProperty, - [...remainingNames.skip(1)]); - }, - isNullValue: (CT_ c) => false, - renderValue: (CT_ c, RendererBase r, - List ast, StringSink sink) { - _render_String(c.name, ast, r.template, sink, parent: r); - }, - ), 'sortGroup': Property( getValue: (CT_ c) => c.sortGroup, renderVariable: (CT_ c, Property self, diff --git a/lib/src/model/attribute.dart b/lib/src/model/attribute.dart index 3e1108bc8d..355f989b89 100644 --- a/lib/src/model/attribute.dart +++ b/lib/src/model/attribute.dart @@ -4,6 +4,7 @@ import 'package:collection/collection.dart'; import 'package:dartdoc/src/model/privacy.dart'; +import 'package:meta/meta.dart'; int byAttributeOrdering(Attribute a, Attribute b) { if (a.sortGroup < b.sortGroup) return -1; @@ -11,9 +12,13 @@ int byAttributeOrdering(Attribute a, Attribute b) { return compareAsciiLowerCaseNatural(a.name, b.name); } -/// An attribute includes both explicit annotations in code (e.g. `deprecated`) -/// as well as others added by the documentation system (`read-write`). +/// An attribute on an element. +/// +/// These include both explicit annotations in code (e.g. `deprecated`) as well +/// as others added by the documentation system (e.g. 'no setter'). abstract class Attribute implements Privacy { + // A name, only used for sorting. + @visibleForOverriding final String name; /// Numerical sort group for this attribute.