Skip to content

Commit 1edc247

Browse files
authored
Avoid [this] in Dartdoc comments (#2273)
Dartdoc broke this in dart-lang/dartdoc#3765.
1 parent a164889 commit 1edc247

21 files changed

+74
-74
lines changed

lib/src/ast/css/modifiable/node.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract base class ModifiableCssNode extends CssNode {
1717
ModifiableCssParentNode? get parent => _parent;
1818
ModifiableCssParentNode? _parent;
1919

20-
/// The index of [this] in `parent.children`.
20+
/// The index of `this` in `parent.children`.
2121
///
2222
/// This makes [remove] more efficient.
2323
int? _indexInParent;
@@ -33,7 +33,7 @@ abstract base class ModifiableCssNode extends CssNode {
3333

3434
T accept<T>(ModifiableCssVisitor<T> visitor);
3535

36-
/// Removes [this] from [parent]'s child list.
36+
/// Removes `this` from [parent]'s child list.
3737
///
3838
/// Throws a [StateError] if [parent] is `null`.
3939
void remove() {
@@ -65,10 +65,10 @@ abstract base class ModifiableCssParentNode extends ModifiableCssNode
6565
: _children = children,
6666
children = UnmodifiableListView(children);
6767

68-
/// Returns whether [this] is equal to [other], ignoring their child nodes.
68+
/// Returns whether `this` is equal to [other], ignoring their child nodes.
6969
bool equalsIgnoringChildren(ModifiableCssNode other);
7070

71-
/// Returns a copy of [this] with an empty [children] list.
71+
/// Returns a copy of `this` with an empty [children] list.
7272
///
7373
/// This is *not* a deep copy. If other parts of this node are modifiable,
7474
/// they are shared between the new and old nodes.

lib/src/ast/sass/at_root_query.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ final class AtRootQuery {
6161
{Object? url, Logger? logger, InterpolationMap? interpolationMap}) =>
6262
AtRootQueryParser(contents, url: url, logger: logger).parse();
6363

64-
/// Returns whether [this] excludes [node].
64+
/// Returns whether `this` excludes [node].
6565
///
6666
/// @nodoc
6767
@internal
@@ -76,6 +76,6 @@ final class AtRootQuery {
7676
};
7777
}
7878

79-
/// Returns whether [this] excludes an at-rule with the given [name].
79+
/// Returns whether `this` excludes an at-rule with the given [name].
8080
bool excludesName(String name) => (_all || names.contains(name)) != include;
8181
}

lib/src/ast/sass/expression/binary_operation.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ enum BinaryOperator {
153153
/// The modulo operator, `%`.
154154
modulo('modulo', '%', 6);
155155

156-
/// The English name of [this].
156+
/// The English name of `this`.
157157
final String name;
158158

159-
/// The Sass syntax for [this].
159+
/// The Sass syntax for `this`.
160160
final String operator;
161161

162-
/// The precedence of [this].
162+
/// The precedence of `this`.
163163
///
164164
/// An operator with higher precedence binds tighter.
165165
final int precedence;

lib/src/ast/sass/expression/list.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ final class ListExpression implements Expression {
5858
return buffer.toString();
5959
}
6060

61-
/// Returns whether [expression], contained in [this], needs parentheses when
61+
/// Returns whether [expression], contained in `this`, needs parentheses when
6262
/// printed as Sass source.
6363
bool _elementNeedsParens(Expression expression) => switch (expression) {
6464
ListExpression(

lib/src/ast/sass/expression/string.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class StringExpression implements Expression {
2323
/// included.
2424
final Interpolation text;
2525

26-
/// Whether [this] has quotes.
26+
/// Whether `this` has quotes.
2727
final bool hasQuotes;
2828

2929
FileSpan get span => text.span;

lib/src/ast/sass/expression/unary_operation.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ enum UnaryOperator {
6363
/// The boolean negation operator, `not`.
6464
not('not', 'not');
6565

66-
/// The English name of [this].
66+
/// The English name of `this`.
6767
final String name;
6868

69-
/// The Sass syntax for [this].
69+
/// The Sass syntax for `this`.
7070
final String operator;
7171

7272
const UnaryOperator(this.name, this.operator);

lib/src/ast/selector.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ abstract base class Selector implements AstNode {
8383

8484
Selector(this.span);
8585

86-
/// Prints a warning if [this] is a bogus selector.
86+
/// Prints a warning if `this` is a bogus selector.
8787
///
8888
/// This may only be called from within a custom Sass function. This will
8989
/// throw a [SassException] in Dart Sass 2.0.0.

lib/src/ast/selector/list.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ final class SelectorList extends Selector {
9696
return contents.isEmpty ? null : SelectorList(contents, span);
9797
}
9898

99-
/// Returns a new selector list that represents [this] nested within [parent].
99+
/// Returns a new selector list that represents `this` nested within [parent].
100100
///
101-
/// By default, this replaces [ParentSelector]s in [this] with [parent]. If
101+
/// By default, this replaces [ParentSelector]s in `this` with [parent]. If
102102
/// [preserveParentSelectors] is true, this instead preserves those selectors
103103
/// as parent selectors.
104104
///

lib/src/ast/selector/pseudo.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ final class PseudoSelector extends SimpleSelector {
174174
for (var simple in compound) {
175175
if (simple case PseudoSelector(isElement: true)) {
176176
// A given compound selector may only contain one pseudo element. If
177-
// [compound] has a different one than [this], unification fails.
177+
// [compound] has a different one than `this`, unification fails.
178178
if (isElement) return null;
179179

180180
// Otherwise, this is a pseudo selector and should come before pseudo

lib/src/ast/selector/simple.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ abstract base class SimpleSelector extends Selector {
5959
url: url, logger: logger, allowParent: allowParent)
6060
.parseSimpleSelector();
6161

62-
/// Returns a new [SimpleSelector] based on [this], as though it had been
62+
/// Returns a new [SimpleSelector] based on `this`, as though it had been
6363
/// written with [suffix] at the end.
6464
///
6565
/// Assumes [suffix] is a valid identifier suffix. If this wouldn't produce a

lib/src/async_environment.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ final class AsyncEnvironment {
790790
return Configuration.implicit(configuration);
791791
}
792792

793-
/// Returns a module that represents the top-level members defined in [this],
793+
/// Returns a module that represents the top-level members defined in `this`,
794794
/// that contains [css] and [preModuleComments] as its CSS, which can be
795795
/// extended using [extensionStore].
796796
Module toModule(
@@ -802,7 +802,7 @@ final class AsyncEnvironment {
802802
forwarded: _forwardedModules.andThen((modules) => MapKeySet(modules)));
803803
}
804804

805-
/// Returns a module with the same members and upstream modules as [this], but
805+
/// Returns a module with the same members and upstream modules as `this`, but
806806
/// an empty stylesheet and extension store.
807807
///
808808
/// This is used when resolving imports, since they need to inject forwarded

lib/src/environment.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_environment.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: f7172be68e0a19c4dc2d2ad04fc32a843a98a6bd
8+
// Checksum: e1beeae58a4d5b97cd7d4f01c7d46b0586b508b9
99
//
1010
// ignore_for_file: unused_import
1111

@@ -796,7 +796,7 @@ final class Environment {
796796
return Configuration.implicit(configuration);
797797
}
798798

799-
/// Returns a module that represents the top-level members defined in [this],
799+
/// Returns a module that represents the top-level members defined in `this`,
800800
/// that contains [css] and [preModuleComments] as its CSS, which can be
801801
/// extended using [extensionStore].
802802
Module<Callable> toModule(
@@ -808,7 +808,7 @@ final class Environment {
808808
forwarded: _forwardedModules.andThen((modules) => MapKeySet(modules)));
809809
}
810810

811-
/// Returns a module with the same members and upstream modules as [this], but
811+
/// Returns a module with the same members and upstream modules as `this`, but
812812
/// an empty stylesheet and extension store.
813813
///
814814
/// This is used when resolving imports, since they need to inject forwarded

lib/src/extend/extension_store.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,12 @@ class ExtensionStore {
386386
}
387387
}
388388

389-
/// Extends [this] with all the extensions in [extensions].
389+
/// Extends `this` with all the extensions in [extensions].
390390
///
391-
/// These extensions will extend all selectors already in [this], but they
391+
/// These extensions will extend all selectors already in `this`, but they
392392
/// will *not* extend other extensions from [extensionStores].
393393
void addExtensions(Iterable<ExtensionStore> extensionStores) {
394-
// Extensions already in [this] whose extenders are extended by
394+
// Extensions already in `this` whose extenders are extended by
395395
// [extensions], and thus which need to be updated.
396396
List<Extension>? extensionsToExtend;
397397

@@ -966,8 +966,8 @@ class ExtensionStore {
966966
return specificity;
967967
}
968968

969-
/// Returns a copy of [this] that extends new selectors, as well as a map
970-
/// (with reference equality) from the selectors extended by [this] to the
969+
/// Returns a copy of `this` that extends new selectors, as well as a map
970+
/// (with reference equality) from the selectors extended by `this` to the
971971
/// selectors extended by the new [ExtensionStore].
972972
(ExtensionStore, Map<SelectorList, Box<SelectorList>>) clone() {
973973
var newSelectors = <SimpleSelector, Set<ModifiableBox<SelectorList>>>{};

lib/src/stylesheet_graph.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class StylesheetNode {
385385
_upstreamImports = newUpstreamImports;
386386
}
387387

388-
/// Removes [this] as an upstream and downstream node from all the nodes that
388+
/// Removes `this` as an upstream and downstream node from all the nodes that
389389
/// import it and that it imports.
390390
void _remove() {
391391
for (var node in {...upstream.values, ...upstreamImports.values}) {

lib/src/util/map.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import 'option.dart';
66

77
extension MapExtensions<K, V> on Map<K, V> {
8-
/// If [this] doesn't contain the given [key], sets that key to [value] and
8+
/// If `this` doesn't contain the given [key], sets that key to [value] and
99
/// returns it.
1010
///
1111
/// Otherwise, calls [merge] with the existing value and [value] and sets

lib/src/util/multi_span.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class MultiSpan implements FileSpan {
7070
primaryColor: primaryColor,
7171
secondaryColor: secondaryColor);
7272

73-
/// Returns a copy of [this] with [newPrimary] as its primary span.
73+
/// Returns a copy of `this` with [newPrimary] as its primary span.
7474
MultiSpan _withPrimary(FileSpan newPrimary) =>
7575
MultiSpan._(newPrimary, primaryLabel, secondarySpans);
7676
}

lib/src/util/nullable.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// https://opensource.org/licenses/MIT.
44

55
extension NullableExtension<T> on T? {
6-
/// If [this] is `null`, returns `null`. Otherwise, runs [fn] and returns its
6+
/// If `this` is `null`, returns `null`. Otherwise, runs [fn] and returns its
77
/// result.
88
///
99
/// Based on Rust's `Option.and_then`.

lib/src/util/span.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ extension SpanExtensions on FileSpan {
8484
return subspan(scanner.position).trimLeft();
8585
}
8686

87-
/// Whether [this] FileSpan contains the [target] FileSpan.
87+
/// Whether this [FileSpan] contains the [target] FileSpan.
8888
///
8989
/// Validates the FileSpans to be in the same file and for the [target] to be
90-
/// within [this] FileSpan inclusive range [start,end].
90+
/// within this [FileSpan]'s inclusive range `[start,end]`.
9191
bool contains(FileSpan target) =>
9292
file.url == target.file.url &&
9393
start.offset <= target.start.offset &&

0 commit comments

Comments
 (0)