Skip to content

Commit

Permalink
Stop supporting '[this]' as a comment reference. (#3765)
Browse files Browse the repository at this point in the history
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 #3761
  • Loading branch information
srawlins authored Jun 18, 2024
1 parent 818d1f5 commit 822ca00
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 8.0.10-dev

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

## 8.0.9

Expand Down
2 changes: 1 addition & 1 deletion lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ abstract class DartdocOption<T extends Object?> {
U getValueAs<U>(String name, Folder dir) =>
_children[name]?.valueAt(dir) as U;

/// Apply the function [visit] to [this] and all children.
/// Apply the function [visit] to this [DartdocOption] and all children.
void traverse(void Function(DartdocOption option) visit) {
visit(this);
for (var value in _children.values) {
Expand Down
1 change: 0 additions & 1 deletion lib/src/model/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ abstract class Container extends ModelElement
.addEntriesIfAbsent(modelElement.parameters.generateEntries());
}
}
referenceChildren['this'] = this;
return referenceChildren;
}();

Expand Down
3 changes: 0 additions & 3 deletions test/end2end/model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2742,9 +2742,6 @@ void main() async {
doAwesomeStuff, 'BaseForDocComments.aNonDefaultConstructor'),
equals(MatchingLinkResult(aNonDefaultConstructor)));

expect(referenceLookup(doAwesomeStuff, 'this'),
equals(MatchingLinkResult(baseForDocComments)));

expect(referenceLookup(doAwesomeStuff, 'value'),
equals(MatchingLinkResult(doAwesomeStuffParam)));

Expand Down

0 comments on commit 822ca00

Please sign in to comment.