Skip to content

Commit

Permalink
Fix doc comment references to 'this' (#150379)
Browse files Browse the repository at this point in the history
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
dart-lang/linter#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
  • Loading branch information
srawlins authored Jun 17, 2024
1 parent 0287c22 commit cf375f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/rendering/object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3325,8 +3325,8 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
/// tree as this [RenderObject], as the behavior is undefined.
///
/// This method ignores [RenderObject.paintsChild]. This means it will still
/// try to compute the paint transform even if [this] or `target` is currently
/// not visible.
/// try to compute the paint transform even if this [RenderObject] or
/// `target` is currently not visible.
///
/// If `target` is null, this method returns a matrix that maps from the
/// local paint coordinate system to the coordinate system of the
Expand Down
16 changes: 7 additions & 9 deletions packages/flutter/lib/src/semantics/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3878,9 +3878,8 @@ class SemanticsConfiguration {
/// This is a request to increase the value represented by the widget. For
/// example, this action might be recognized by a slider control.
///
/// If [this.value] is set, [increasedValue] must also be provided and
/// [onIncrease] must ensure that [this.value] will be set to
/// [increasedValue].
/// If [value] is set, [increasedValue] must also be provided and
/// [onIncrease] must ensure that [value] will be set to [increasedValue].
///
/// VoiceOver users on iOS can trigger this action by swiping up with one
/// finger. TalkBack users on Android can trigger this action by pressing the
Expand All @@ -3897,9 +3896,8 @@ class SemanticsConfiguration {
/// This is a request to decrease the value represented by the widget. For
/// example, this action might be recognized by a slider control.
///
/// If [this.value] is set, [decreasedValue] must also be provided and
/// [onDecrease] must ensure that [this.value] will be set to
/// [decreasedValue].
/// If [value] is set, [decreasedValue] must also be provided and
/// [onDecrease] must ensure that [value] will be set to [decreasedValue].
///
/// VoiceOver users on iOS can trigger this action by swiping down with one
/// finger. TalkBack users on Android can trigger this action by pressing the
Expand Down Expand Up @@ -4812,11 +4810,11 @@ class SemanticsConfiguration {
_setFlag(SemanticsFlag.isReadOnly, value);
}

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

/// The currently selected text (or the position of the cursor) within
/// [this.value] if this node represents a text field.
/// [value] if this node represents a text field.
TextSelection? get textSelection => _textSelection;
TextSelection? _textSelection;
set textSelection(TextSelection? value) {
Expand Down

0 comments on commit cf375f0

Please sign in to comment.