diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index c7508147cc..e2e0d67082 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -2777,7 +2777,6 @@ class _Renderer_Container extends RendererBase { ..._Renderer_ModelElement.propertyMap(), ..._Renderer_Categorization.propertyMap(), ..._Renderer_TypeParameters.propertyMap(), - ..._Renderer_HideConstantImplementations.propertyMap(), 'aboveSidebarPath': Property( getValue: (CT_ c) => c.aboveSidebarPath, renderVariable: @@ -7115,38 +7114,6 @@ class _Renderer_HasNoPage extends RendererBase { } } -class _Renderer_HideConstantImplementations - extends RendererBase { - static final Map _propertyMapCache = {}; - static Map> - propertyMap() => - _propertyMapCache.putIfAbsent( - CT_, - () => { - 'hasHideConstantImplementations': Property( - getValue: (CT_ c) => c.hasHideConstantImplementations, - renderVariable: (CT_ c, Property self, - List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'bool'), - getBool: (CT_ c) => - c.hasHideConstantImplementations == true, - ), - }) as Map>; - - _Renderer_HideConstantImplementations(HideConstantImplementations context, - RendererBase? parent, Template template, StringSink sink) - : super(context, parent, template, sink); - - @override - Property? getProperty(String key) { - if (propertyMap().containsKey(key)) { - return propertyMap()[key]; - } else { - return null; - } - } -} - class _Renderer_Indexable extends RendererBase { static final Map _propertyMapCache = {}; static Map> propertyMap() => @@ -8167,7 +8134,6 @@ class _Renderer_Library extends RendererBase { ..._Renderer_Categorization.propertyMap(), ..._Renderer_TopLevelContainer.propertyMap(), ..._Renderer_CanonicalFor.propertyMap(), - ..._Renderer_HideConstantImplementations.propertyMap(), 'aboveSidebarPath': Property( getValue: (CT_ c) => c.aboveSidebarPath, renderVariable: @@ -12607,7 +12573,7 @@ class _Renderer_Package extends RendererBase { } } -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(); @@ -12845,7 +12811,7 @@ class _Renderer_PackageTemplateData extends RendererBase { } } -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(); diff --git a/lib/src/model/container.dart b/lib/src/model/container.dart index cbac2462dc..6466b8b0c0 100644 --- a/lib/src/model/container.dart +++ b/lib/src/model/container.dart @@ -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? diff --git a/lib/src/model/directives/hide_constant_implementations.dart b/lib/src/model/directives/hide_constant_implementations.dart deleted file mode 100644 index 9815cf88e0..0000000000 --- a/lib/src/model/directives/hide_constant_implementations.dart +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:dartdoc/src/model/documentation_comment.dart'; -import 'package:dartdoc/src/model/model_element.dart'; - -final _hideConstantImplementationsRegExp = - RegExp(r'{@hideConstantImplementations}'); - -/// Implement parsing the hideConstantImplementations dartdoc directive -/// for this [ModelElement]. Used by [Container]. -mixin HideConstantImplementations on DocumentationComment { - bool? _hasHideConstantImplementations; - - /// [true] if the `{@hideConstantImplementations}` dartdoc directive is - /// present in the documentation for this class. - bool get hasHideConstantImplementations { - if (_hasHideConstantImplementations == null) { - buildDocumentationAddition(documentationComment); - } - return _hasHideConstantImplementations!; - } - - /// Hides `{@hideConstantImplementations}` from doc while leaving a note to - /// ourselves to change rendering for these constants. - /// Example: - /// - /// {@hideConstantImplementations} - @override - String buildDocumentationAddition(String rawDocs) { - rawDocs = super.buildDocumentationAddition(rawDocs); - _hasHideConstantImplementations = false; - rawDocs = rawDocs.replaceAllMapped(_hideConstantImplementationsRegExp, - (Match match) { - _hasHideConstantImplementations = true; - return ''; - }); - return rawDocs; - } -} diff --git a/lib/src/model/documentation_comment.dart b/lib/src/model/documentation_comment.dart index fcbdb9163e..81673801dd 100644 --- a/lib/src/model/documentation_comment.dart +++ b/lib/src/model/documentation_comment.dart @@ -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: diff --git a/lib/src/model/library.dart b/lib/src/model/library.dart index 8e8f578877..6c6f0a9bbb 100644 --- a/lib/src/model/library.dart +++ b/lib/src/model/library.dart @@ -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; diff --git a/lib/src/model/model.dart b/lib/src/model/model.dart index 2c3954286b..f3e9e80522 100644 --- a/lib/src/model/model.dart +++ b/lib/src/model/model.dart @@ -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';