<commit_before>// Copyright (c) 2021, 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:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:dartdoc/src/element_type.dart';
import 'package:dartdoc/src/model/class.dart';
import 'package:dartdoc/src/model/comment_referable.dart';
import 'package:dartdoc/src/model/extension_target.dart';
import 'package:dartdoc/src/model/model.dart';
import 'package:dartdoc/src/model_utils.dart' as model_utils;
import 'package:dartdoc/src/quiver.dart' as quiver;
import 'package:meta/meta.dart';

/// A mixin to build an [InheritingContainer] capable of being constructed
/// with a direct call to a [Constructor] in Dart.
///
/// Note that [Constructor]s are not considered to be modifiers so a
/// [hasModifier] override is not necessary for this mixin.
mixin Constructable on InheritingContainer {
  List<Constructor> _constructors;
  Iterable<Constructor> get constructors => _constructors ??= element
      .constructors
      .map((e) => ModelElement.from(e, library, packageGraph) as Constructor);

  @override
  bool get hasPublicConstructors => publicConstructorsSorted.isNotEmpty;

  @visibleForTesting
  Iterable<Constructor> get publicConstructors =>
      model_utils.filterNonPublic(constructors);

  List<Constructor> _publicConstructorsSorted;

  @override
  Iterable<Constructor> get publicConstructorsSorted =>
      _publicConstructorsSorted ??= publicConstructors.toList()..sort(byName);

  Constructor _unnamedConstructor;<commit_msg>forgot list construction<commit_after>// Copyright (c) 2021, 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:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:dartdoc/src/element_type.dart';
import 'package:dartdoc/src/model/class.dart';
import 'package:dartdoc/src/model/comment_referable.dart';
import 'package:dartdoc/src/model/extension_target.dart';
import 'package:dartdoc/src/model/model.dart';
import 'package:dartdoc/src/model_utils.dart' as model_utils;
import 'package:dartdoc/src/quiver.dart' as quiver;
import 'package:meta/meta.dart';

/// A mixin to build an [InheritingContainer] capable of being constructed
/// with a direct call to a [Constructor] in Dart.
///
/// Note that [Constructor]s are not considered to be modifiers so a
/// [hasModifier] override is not necessary for this mixin.
mixin Constructable on InheritingContainer {
  List<Constructor> _constructors;
  Iterable<Constructor> get constructors => _constructors ??= [...element
      .constructors
      .map((e) => ModelElement.from(e, library, packageGraph) as Constructor)];

  @override
  bool get hasPublicConstructors => publicConstructorsSorted.isNotEmpty;

  @visibleForTesting
  Iterable<Constructor> get publicConstructors =>
      model_utils.filterNonPublic(constructors);

  List<Constructor> _publicConstructorsSorted;

  @override
  Iterable<Constructor> get publicConstructorsSorted =>
      _publicConstructorsSorted ??= publicConstructors.toList()..sort(byName);

  Constructor _unnamedConstructor;
{'fraction_non_alphanumeric': 0.10456942003514938, 'fraction_numerical': 0.0023432923257176333, 'mean_word_length': 5.186594202898551, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2874961', 'n_tokens_mistral': 1024, 'n_tokens_neox': 1002, 'n_words': 275}