front_end: replace unsupported `[this]` comment references with this [Type].

Work towards https://github.com/dart-lang/dartdoc/issues/3761

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.

Change-Id: I49478bb39f135d87acff4047767743862c6b8551
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365305
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
index 3dfaa7d..92a5469 100644
--- a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
+++ b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
@@ -117,7 +117,7 @@
   /// [libraryUri] must refer to either a previously compiled library.
   /// [className] may optionally refer to a class within such library to use for
   /// the scope of the expression. In that case, [isStatic] indicates whether
-  /// the scope can access [this].
+  /// the scope can access this [IncrementalKernelGenerator].
   ///
   /// It is illegal to use "await" in [expression] and the compiled function
   /// will always be synchronous.
diff --git a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
index df61de7..74cccab 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
@@ -90,9 +90,9 @@
   /// Returns `null` if an error occurred.
   ///
   /// The method substitutes through the chain of type aliases denoted by
-  /// [this], such that the returned [TypeBuilder]s are appropriate type
-  /// arguments for passing to the [ClassBuilder] which is the end of the
-  /// unaliasing chain.
+  /// this [TypeAliasBuilder], such that the returned [TypeBuilder]s are
+  /// appropriate type arguments for passing to the [ClassBuilder] which is the
+  /// end of the unaliasing chain.
   // TODO(johnniwinther): Should we enforce that [typeArguments] are non-null
   // as stated in the docs? It is not needed for the implementation.
   List<TypeBuilder>? unaliasTypeArguments(List<TypeBuilder>? typeArguments);
@@ -521,8 +521,8 @@
   /// Returns `null` if an error occurred.
   ///
   /// The method substitutes through the chain of type aliases denoted by
-  /// [this], such that the returned [TypeBuilder]s are appropriate type
-  /// arguments for passing to the [ClassBuilder] or
+  /// this [TypeAliasBuilderImpl], such that the returned [TypeBuilder]s are
+  /// appropriate type arguments for passing to the [ClassBuilder] or
   /// [ExtensionTypeDeclarationBuilder] which is the end of the unaliasing
   /// chain.
   @override
diff --git a/pkg/front_end/lib/src/fasta/compiler_context.dart b/pkg/front_end/lib/src/fasta/compiler_context.dart
index 41d3edb..72b5e9d 100644
--- a/pkg/front_end/lib/src/fasta/compiler_context.dart
+++ b/pkg/front_end/lib/src/fasta/compiler_context.dart
@@ -102,8 +102,8 @@
 
   static bool get isActive => Zone.current[compilerContextKey] != null;
 
-  /// Perform [action] in a [Zone] where [this] will be available as
-  /// `CompilerContext.current`.
+  /// Perform [action] in a [Zone] where this [CompilerContext] will be
+  /// available as `CompilerContext.current`.
   Future<T> runInContext<T>(Future<T> action(CompilerContext c)) {
     return runZoned(
         () => new Future<T>.sync(() => action(this)).whenComplete(clear),
diff --git a/pkg/front_end/lib/src/fasta/kernel/member_covariance.dart b/pkg/front_end/lib/src/fasta/kernel/member_covariance.dart
index 24fffa8..96eff2aa 100644
--- a/pkg/front_end/lib/src/fasta/kernel/member_covariance.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/member_covariance.dart
@@ -204,7 +204,7 @@
   }
 
   /// Returns the merge of this covariance with [other] in which parameters are
-  /// covariant if they are covariant in either [this] or [other].
+  /// covariant if they are covariant in either this [Covariance] or [other].
   Covariance merge(Covariance other) {
     if (identical(this, other)) return this;
     List<int>? positionalParameters;
@@ -260,7 +260,7 @@
   }
 
   /// Update [member] to have the covariant flags set with the covariance in
-  /// [this].
+  /// this [Covariance].
   ///
   /// No covariance bits are removed from [member] during this process.
   void applyCovariance(Member member) {