Skip to content

Commit cf375f0

Browse files
authored
Fix doc comment references to 'this' (flutter#150379)
Work towards dart-lang/dartdoc#3761 Sibling CL to https://dart-review.googlesource.com/c/sdk/+/365204 The analyzer has never recognized `[this]` as a valid doc comment reference (and the `comment_references` lint rule has similarly reported such reference attempts). dartdoc has its own algorithms for resolving comment references, which we are dismantling in favor of a single resolution, provided by the analyzer. We've also decided against adding support in the analyzer (see https://github.com/dart-lang/linter/issues/2079), so these reference attempts should be re-written. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 0287c22 commit cf375f0

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

packages/flutter/lib/src/rendering/object.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3325,8 +3325,8 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
33253325
/// tree as this [RenderObject], as the behavior is undefined.
33263326
///
33273327
/// This method ignores [RenderObject.paintsChild]. This means it will still
3328-
/// try to compute the paint transform even if [this] or `target` is currently
3329-
/// not visible.
3328+
/// try to compute the paint transform even if this [RenderObject] or
3329+
/// `target` is currently not visible.
33303330
///
33313331
/// If `target` is null, this method returns a matrix that maps from the
33323332
/// local paint coordinate system to the coordinate system of the

packages/flutter/lib/src/semantics/semantics.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,9 +3878,8 @@ class SemanticsConfiguration {
38783878
/// This is a request to increase the value represented by the widget. For
38793879
/// example, this action might be recognized by a slider control.
38803880
///
3881-
/// If [this.value] is set, [increasedValue] must also be provided and
3882-
/// [onIncrease] must ensure that [this.value] will be set to
3883-
/// [increasedValue].
3881+
/// If [value] is set, [increasedValue] must also be provided and
3882+
/// [onIncrease] must ensure that [value] will be set to [increasedValue].
38843883
///
38853884
/// VoiceOver users on iOS can trigger this action by swiping up with one
38863885
/// finger. TalkBack users on Android can trigger this action by pressing the
@@ -3897,9 +3896,8 @@ class SemanticsConfiguration {
38973896
/// This is a request to decrease the value represented by the widget. For
38983897
/// example, this action might be recognized by a slider control.
38993898
///
3900-
/// If [this.value] is set, [decreasedValue] must also be provided and
3901-
/// [onDecrease] must ensure that [this.value] will be set to
3902-
/// [decreasedValue].
3899+
/// If [value] is set, [decreasedValue] must also be provided and
3900+
/// [onDecrease] must ensure that [value] will be set to [decreasedValue].
39033901
///
39043902
/// VoiceOver users on iOS can trigger this action by swiping down with one
39053903
/// finger. TalkBack users on Android can trigger this action by pressing the
@@ -4812,11 +4810,11 @@ class SemanticsConfiguration {
48124810
_setFlag(SemanticsFlag.isReadOnly, value);
48134811
}
48144812

4815-
/// Whether [this.value] should be obscured.
4813+
/// Whether [value] should be obscured.
48164814
///
48174815
/// This option is usually set in combination with [isTextField] to indicate
48184816
/// that the text field contains a password (or other sensitive information).
4819-
/// Doing so instructs screen readers to not read out [this.value].
4817+
/// Doing so instructs screen readers to not read out [value].
48204818
bool get isObscured => _hasFlag(SemanticsFlag.isObscured);
48214819
set isObscured(bool value) {
48224820
_setFlag(SemanticsFlag.isObscured, value);
@@ -4844,7 +4842,7 @@ class SemanticsConfiguration {
48444842
}
48454843

48464844
/// The currently selected text (or the position of the cursor) within
4847-
/// [this.value] if this node represents a text field.
4845+
/// [value] if this node represents a text field.
48484846
TextSelection? get textSelection => _textSelection;
48494847
TextSelection? _textSelection;
48504848
set textSelection(TextSelection? value) {

0 commit comments

Comments
 (0)