Skip to content

Commit f34551d

Browse files
committed
Stop supporting '[this]' as a comment reference.
The analyzer does not support it and does not intend to, so this change aligns with that effort. It makes analyzing the gap between analyzer and dartdoc easier as well. Fixes dart-lang#3761
1 parent 6b2ee57 commit f34551d

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## 8.0.10-dev
22

33
* Un-deprecate the `--resources-dir` option.
4+
* Remove support for `[this]` as a comment reference. Referring to the
5+
containing element can be written as `this [Foo]`, and referring to 'this'
6+
can just be written as `` `this` ``.
47

58
## 8.0.9
69

lib/src/dartdoc_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ abstract class DartdocOption<T extends Object?> {
572572
U getValueAs<U>(String name, Folder dir) =>
573573
_children[name]?.valueAt(dir) as U;
574574

575-
/// Apply the function [visit] to [this] and all children.
575+
/// Apply the function [visit] to this [DartdocOption] and all children.
576576
void traverse(void Function(DartdocOption option) visit) {
577577
visit(this);
578578
for (var value in _children.values) {

lib/src/model/container.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ abstract class Container extends ModelElement
242242
.addEntriesIfAbsent(modelElement.parameters.generateEntries());
243243
}
244244
}
245-
referenceChildren['this'] = this;
246245
return referenceChildren;
247246
}();
248247

test/end2end/model_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,9 +2742,6 @@ void main() async {
27422742
doAwesomeStuff, 'BaseForDocComments.aNonDefaultConstructor'),
27432743
equals(MatchingLinkResult(aNonDefaultConstructor)));
27442744

2745-
expect(referenceLookup(doAwesomeStuff, 'this'),
2746-
equals(MatchingLinkResult(baseForDocComments)));
2747-
27482745
expect(referenceLookup(doAwesomeStuff, 'value'),
27492746
equals(MatchingLinkResult(doAwesomeStuffParam)));
27502747

0 commit comments

Comments
 (0)