Skip to content

Commit 6524033

Browse files
authored
Fix most comment reference issues (#3946)
1 parent 51256a3 commit 6524033

16 files changed

+40
-36
lines changed

lib/src/dartdoc_options.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class _OptionValueWithContext<T> {
194194
/// If non-null, the basename of the configuration file the value came from.
195195
String? definingFile;
196196

197-
/// A [pathLib.Context] variable initialized with 'canonicalDirectoryPath'.
197+
/// A [p.Context] variable initialized with 'canonicalDirectoryPath'.
198198
p.Context pathContext;
199199

200200
/// Build a _OptionValueWithContext.
@@ -795,8 +795,8 @@ mixin _DartdocFileOption<T> implements DartdocOption<T> {
795795
return __valueAtFromFiles[key];
796796
}
797797

798-
/// Searches all dartdoc_options files through parent directories, starting at
799-
/// [dir], for the option and returns one once found.
798+
/// Searches all dartdoc options files through parent directories, starting at
799+
/// [folder], for the option and returns one once found.
800800
_OptionValueWithContext<T>? _valueAtFromFilesFirstFound(Folder folder) {
801801
_OptionValueWithContext<T>? value;
802802
for (var dir in folder.withAncestors) {
@@ -975,8 +975,8 @@ mixin _DartdocArgOption<T> implements DartdocOption<T> {
975975
'missing path: "$missingPath"');
976976
}
977977

978-
/// Generates an _OptionValueWithContext using the value of the argument from
979-
/// the [argParser] and the working directory from [_directoryCurrent].
978+
/// Generates an [_OptionValueWithContext] using the value of the argument
979+
/// from the [_argResults] and the working directory from [_directoryCurrent].
980980
///
981981
/// Throws [UnsupportedError] if [T] is not a supported type.
982982
_OptionValueWithContext<T>? _valueAtFromArgsWithContext() {

lib/src/generator/html_generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'package:meta/meta.dart';
1616

1717
/// Creates a [Generator] with an [HtmlGeneratorBackend] backend.
1818
///
19-
/// [forceRuntimeTemplates] should only be given [true] during tests.
19+
/// [forceRuntimeTemplates] should only be given `true` during tests.
2020
Future<Generator> initHtmlGenerator(
2121
DartdocGeneratorOptionContext context, {
2222
required FileWriter writer,

lib/src/generator/templates.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ abstract class Templates {
115115
/// Creates a [Templates] instance either from the default set of templates,
116116
/// or a custom set if the 'templatesDir' Dartdoc option is used.
117117
///
118-
/// [forceRuntimeTemplates] should only be given [true] during tests.
118+
/// [forceRuntimeTemplates] should only be given `true` during tests.
119119
static Future<Templates> fromContext(DartdocGeneratorOptionContext context,
120120
{bool forceRuntimeTemplates = false}) async {
121121
var templatesDir = context.templatesDir;

lib/src/model/container_modifiers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ContainerModifier implements Comparable<ContainerModifier> {
4343
}
4444

4545
extension BuildLanguageFeatureSet on Iterable<ContainerModifier> {
46-
/// Transforms [ContainerModifiers] into a series of [LanguageFeature] objects
46+
/// Transforms [ContainerModifier]s into a series of [LanguageFeature] objects
4747
/// suitable for rendering as chips. Assumes iterable is sorted.
4848
Iterable<LanguageFeature> get asLanguageFeatureSet =>
4949
where((m) => !m.hideIfPresent.any(contains))

lib/src/model/documentation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Documentation {
2323
/// A guard against re-computing [_asHtml].
2424
bool _hasHtmlBeenRendered = false;
2525

26-
/// A guard against re-computing [_asHOneLiner].
26+
/// A guard against re-computing [_asOneLiner].
2727
bool _hasOneLinerBeenRendered = false;
2828

2929
String get asHtml {

lib/src/model/documentation_comment.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
/// @docImport 'package:dartdoc/src/model/package_graph.dart';
6+
library;
7+
58
import 'package:analyzer/dart/element/element.dart';
69
import 'package:args/args.dart';
710
import 'package:crypto/crypto.dart' as crypto;
@@ -835,8 +838,8 @@ mixin DocumentationComment
835838

836839
/// Replace `<dartdoc-html>[digest]</dartdoc-html>` in API comments with
837840
/// the contents of the HTML fragment earlier defined by the
838-
/// &#123;@inject-html&#125; directive. The [digest] is a SHA1 of the contents
839-
/// of the HTML fragment, automatically generated upon parsing the
841+
/// &#123;@inject-html&#125; directive. The `[digest]` is a SHA1 of the
842+
/// contents of the HTML fragment, automatically generated upon parsing the
840843
/// &#123;@inject-html&#125; directive.
841844
///
842845
/// This markup is generated and inserted by [_stripHtmlAndAddToIndex] when it

lib/src/model/inheritable.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ import 'package:dartdoc/src/model/model.dart';
1414
/// We can search the inheritance chain between this instance and
1515
/// [definingEnclosingContainer] in [Inheritable.canonicalEnclosingContainer],
1616
/// for the canonical [Class] closest to where this member was defined. We
17-
/// can then know that when we find [Inheritable.modelElement] inside that
18-
/// [Class]'s namespace, that's the one we should treat as canonical and
19-
/// implementors of this class can use that knowledge to determine
20-
/// canonicalization.
17+
/// can then know that when we find [Inheritable.element] inside that [Class]'s
18+
/// namespace, that's the one we should treat as canonical and implementors of
19+
/// this class can use that knowledge to determine canonicalization.
2120
///
2221
/// We pick the class closest to the [definingEnclosingContainer] so that all
2322
/// children of that class inheriting the same member will point to the same

lib/src/model/locatable.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mixin Locatable {
1616
/// class doesn't have docs for this element.
1717
List<Locatable> get documentationFrom;
1818

19-
/// True if documentationFrom contains only one item, [this].
19+
/// Whether [documentationFrom] contains only one item, `this`.
2020
bool get documentationIsLocal =>
2121
documentationFrom.length == 1 && identical(documentationFrom.first, this);
2222

lib/src/model/model_element.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ abstract class ModelElement
255255
return newModelElement;
256256
}
257257

258-
/// Caches a newly-created [ModelElement] from [ModelElement._from] or
258+
/// Caches a newly-created [ModelElement] from [ModelElement.for_] or
259259
/// [ModelElement.forPropertyInducingElement].
260260
static void _cacheNewModelElement(
261261
Element e, ModelElement newModelElement, Library library,

lib/src/model/package_graph.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,6 @@ class PackageGraph with CommentReferable, Nameable {
707707
/// If we know the element is related to a particular class, pass a
708708
/// [preferredClass] to disambiguate.
709709
///
710-
/// This doesn't know anything about [PackageGraph.inheritThrough] and
711-
/// probably shouldn't, so using it with [Inheritable]s without special casing
712-
/// is not advised.
713-
///
714710
/// This can return `null` in a few ways: if [modelElement] is `null`, or if
715711
/// it has no canonical library, or if a possible canonical model element has
716712
/// a `false` value for `isCanonical`.

0 commit comments

Comments
 (0)