Skip to content

Commit

Permalink
observatory: replace unsupported [this] comment references with `th…
Browse files Browse the repository at this point in the history
…is`.

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.

TEST=Nope
Change-Id: Ie584a8338d4b203c4dce737769dbf2bd9094a42c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366881
Auto-Submit: Samuel Rawlins <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
  • Loading branch information
srawlins authored and Commit Queue committed May 16, 2024
1 parent 6eb6d4f commit 8b53d26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions runtime/observatory/lib/src/service/object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ abstract class ServiceObject implements M.ObjectRef {
return obj;
}

/// If [this] was created from a reference, load the full object
/// from the service by calling [reload]. Else, return [this].
/// If this [ServiceObject] was created from a reference, load the full
/// object from the service by calling [reload]. Else, return this
/// [ServiceObject].
Future<ServiceObject> load() {
if (loaded) {
return new Future.value(this);
Expand All @@ -340,8 +341,8 @@ abstract class ServiceObject implements M.ObjectRef {
return isolate!.invokeRpcNoUpgrade('getObject', params);
}

/// Reload [this]. Returns a future which completes to [this] or
/// an exception.
/// Reload this [ServiceObject]. Returns a future which completes to this
/// [ServiceObject] or an exception.
Future<ServiceObject> reload({int count = kDefaultFieldLimit}) {
// TODO(turnidge): Checking for a null id should be part of the
// "immutable" check.
Expand Down Expand Up @@ -380,7 +381,8 @@ abstract class ServiceObject implements M.ObjectRef {
return _inProgressReload!;
}

/// Update [this] using [map] as a source. [map] can be a reference.
/// Update this [ServiceObject] using [map] as a source. [map] can be a
/// reference.
void updateFromServiceMap(Map map) {
assert(_isServiceMap(map));

Expand Down Expand Up @@ -4349,7 +4351,7 @@ class Code extends HeapObject implements M.Code {
}
}

/// Reload [this]. Returns a future which completes to [this] or an
/// Reload this [Code]. Returns a future which completes to `this` or an
/// exception.
Future<ServiceObject> reload({int count = kDefaultFieldLimit}) {
assert(kind != null);
Expand Down Expand Up @@ -4501,7 +4503,7 @@ class Code extends HeapObject implements M.Code {
}
}

/// Returns true if [address] is contained inside [this].
/// Returns true if [address] is contained inside this [Code].
bool contains(int address) {
return (address >= startAddress) && (address < endAddress);
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/observatory/lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ class Task {

Task(this.callback);

/// Queue [this] to run on the next Dart event queue pump. Does nothing
/// if [this] is already queued.
/// Queue this [Task] to run on the next Dart event queue pump. Does nothing
/// if this [Task] is already queued.
queue() {
if (_timer != null) {
// Already scheduled.
Expand Down

0 comments on commit 8b53d26

Please sign in to comment.