Skip to content

Commit

Permalink
Remove @hideConstantImplementations fully. (#3593)
Browse files Browse the repository at this point in the history
  • Loading branch information
kallentu committed Dec 5, 2023
1 parent 2a84930 commit 2244cf0
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 85 deletions.
38 changes: 2 additions & 36 deletions lib/src/generator/templates.runtime_renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2777,7 +2777,6 @@ class _Renderer_Container extends RendererBase<Container> {
..._Renderer_ModelElement.propertyMap<CT_>(),
..._Renderer_Categorization.propertyMap<CT_>(),
..._Renderer_TypeParameters.propertyMap<CT_>(),
..._Renderer_HideConstantImplementations.propertyMap<CT_>(),
'aboveSidebarPath': Property(
getValue: (CT_ c) => c.aboveSidebarPath,
renderVariable:
Expand Down Expand Up @@ -7115,38 +7114,6 @@ class _Renderer_HasNoPage extends RendererBase<HasNoPage> {
}
}

class _Renderer_HideConstantImplementations
extends RendererBase<HideConstantImplementations> {
static final Map<Type, Object> _propertyMapCache = {};
static Map<String, Property<CT_>>
propertyMap<CT_ extends HideConstantImplementations>() =>
_propertyMapCache.putIfAbsent(
CT_,
() => {
'hasHideConstantImplementations': Property(
getValue: (CT_ c) => c.hasHideConstantImplementations,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) =>
c.hasHideConstantImplementations == true,
),
}) as Map<String, Property<CT_>>;

_Renderer_HideConstantImplementations(HideConstantImplementations context,
RendererBase<Object>? parent, Template template, StringSink sink)
: super(context, parent, template, sink);

@override
Property<HideConstantImplementations>? getProperty(String key) {
if (propertyMap<HideConstantImplementations>().containsKey(key)) {
return propertyMap<HideConstantImplementations>()[key];
} else {
return null;
}
}
}

class _Renderer_Indexable extends RendererBase<Indexable> {
static final Map<Type, Object> _propertyMapCache = {};
static Map<String, Property<CT_>> propertyMap<CT_ extends Indexable>() =>
Expand Down Expand Up @@ -8167,7 +8134,6 @@ class _Renderer_Library extends RendererBase<Library> {
..._Renderer_Categorization.propertyMap<CT_>(),
..._Renderer_TopLevelContainer.propertyMap<CT_>(),
..._Renderer_CanonicalFor.propertyMap<CT_>(),
..._Renderer_HideConstantImplementations.propertyMap<CT_>(),
'aboveSidebarPath': Property(
getValue: (CT_ c) => c.aboveSidebarPath,
renderVariable:
Expand Down Expand Up @@ -12607,7 +12573,7 @@ class _Renderer_Package extends RendererBase<Package> {
}
}

String renderIndex(PackageTemplateData context, Template template) {
String renderSearchPage(PackageTemplateData context, Template template) {
var buffer = StringBuffer();
_render_PackageTemplateData(context, template.ast, template, buffer);
return buffer.toString();
Expand Down Expand Up @@ -12845,7 +12811,7 @@ class _Renderer_PackageTemplateData extends RendererBase<PackageTemplateData> {
}
}

String renderSearchPage(PackageTemplateData context, Template template) {
String renderIndex(PackageTemplateData context, Template template) {
var buffer = StringBuffer();
_render_PackageTemplateData(context, template.ast, template, buffer);
return buffer.toString();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import 'package:meta/meta.dart';
/// * **has** : boolean getters indicating whether the underlying collections
/// are empty. These are available mostly for the templating system.
abstract class Container extends ModelElement
with Categorization, TypeParameters, HideConstantImplementations {
with Categorization, TypeParameters {
Container(super.library, super.packageGraph);

// TODO(jcollins-g): Implement a ContainerScope that flattens supertypes?
Expand Down
41 changes: 0 additions & 41 deletions lib/src/model/directives/hide_constant_implementations.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/src/model/documentation_comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ mixin DocumentationComment
// Other directives, parsed by `model/directives/*.dart`:
'canonicalFor',
'category',
'hideConstantImplementations',
'subCategory',

// Common Dart annotations which may decorate named parameters:
Expand Down
6 changes: 1 addition & 5 deletions lib/src/model/library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ class _LibrarySentinel implements Library {
}

class Library extends ModelElement
with
Categorization,
TopLevelContainer,
CanonicalFor,
HideConstantImplementations {
with Categorization, TopLevelContainer, CanonicalFor {
@override
final LibraryElement element;

Expand Down
1 change: 0 additions & 1 deletion lib/src/model/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export 'container.dart';
export 'container_member.dart';
export 'directives/canonical_for.dart';
export 'directives/categorization.dart';
export 'directives/hide_constant_implementations.dart';
export 'documentable.dart';
export 'documentation.dart';
export 'documentation_comment.dart';
Expand Down

0 comments on commit 2244cf0

Please sign in to comment.