DAS: Clean up some broken comment references

Change-Id: I319620941b6051b138326cab9bbb8985b43216eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402426
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index 5b3468a..2fd41bd 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -47,7 +47,7 @@
   }
 
   /// Returns a [Future] completing with a [List] of references to [element] or
-  /// to the corresponding hierarchy [Element]s.
+  /// to the corresponding hierarchy [Element2]s.
   Future<List<SearchMatch>> _findElementsReferences(
     Element2 element,
     OperationPerformanceImpl performance,
@@ -74,10 +74,10 @@
     return searchEngine.searchReferences(element);
   }
 
-  /// Returns a [Future] completing with [Element]s to search references to.
+  /// Returns a [Future] completing with [Element2]s to search references to.
   ///
-  /// If a [ClassMemberElement] or a named [ParameterElement] is given, each
-  /// corresponding [Element] in the hierarchy is returned.
+  /// If an instance member or a named [FormalParameterElement] is given, each
+  /// corresponding [Element2] in the hierarchy is returned.
   ///
   /// Otherwise, only references to [element] should be searched.
   Future<Iterable<Element2>> _getRefElements(
diff --git a/pkg/analysis_server/lib/src/server/detachable_filesystem_manager.dart b/pkg/analysis_server/lib/src/server/detachable_filesystem_manager.dart
index 77fde4f..9660eb1 100644
--- a/pkg/analysis_server/lib/src/server/detachable_filesystem_manager.dart
+++ b/pkg/analysis_server/lib/src/server/detachable_filesystem_manager.dart
@@ -2,12 +2,15 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+/// @docImport 'package:analysis_server/src/legacy_analysis_server.dart';
+library;
+
 import 'package:analysis_server/src/analysis_server.dart';
 
 /// A class that can be used to configure an analysis server instance to better
 /// support intermittent file systems.
 ///
-/// See also [AnalysisServerOptions.detachableFileSystemManager].
+/// See also [LegacyAnalysisServer.detachableFileSystemManager].
 abstract class DetachableFileSystemManager {
   /// Indicate that the [DetachableFileSystemManager] and the containing
   /// analysis server are being shut down.
diff --git a/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart b/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
index 36695e8..8611c06 100644
--- a/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
+++ b/pkg/analysis_server/lib/src/server/lsp_stdio_server.dart
@@ -7,9 +7,9 @@
 import 'package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart';
 import 'package:analysis_server/src/lsp/lsp_socket_server.dart';
 
-/// Instances of the class [StdioServer] implement a simple server operating
-/// over standard input and output. The primary responsibility of this server
-/// is to split incoming messages on newlines and pass them along to the
+/// Instances of the class [LspStdioAnalysisServer] implement a simple server
+/// operating over standard input and output. The primary responsibility of this
+/// server is to split incoming messages on newlines and pass them along to the
 /// analysis server.
 class LspStdioAnalysisServer {
   /// An object that can handle either a WebSocket connection or a connection
diff --git a/pkg/analysis_server/lib/src/server/stdio_server.dart b/pkg/analysis_server/lib/src/server/stdio_server.dart
index 6d2f8e5..692c543 100644
--- a/pkg/analysis_server/lib/src/server/stdio_server.dart
+++ b/pkg/analysis_server/lib/src/server/stdio_server.dart
@@ -5,9 +5,9 @@
 import 'package:analysis_server/src/channel/byte_stream_channel.dart';
 import 'package:analysis_server/src/socket_server.dart';
 
-/// Instances of the class [StdioServer] implement a simple server operating
-/// over standard input and output. The primary responsibility of this server
-/// is to split incoming messages on newlines and pass them along to the
+/// Instances of the class [StdioAnalysisServer] implement a simple server
+/// operating over standard input and output. The primary responsibility of this
+/// server is to split incoming messages on newlines and pass them along to the
 /// analysis server.
 class StdioAnalysisServer {
   /// An object that can handle either a WebSocket connection or a connection
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart b/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
index 555153a..9f21c9b 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart
@@ -2,6 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+/// @docImport 'package:analyzer/src/utilities/completion_matcher.dart';
+library;
+
 import 'package:analysis_server/src/protocol_server.dart'
     show CompletionSuggestionKind;
 import 'package:analysis_server/src/services/completion/dart/feature_computer.dart';
@@ -375,7 +378,6 @@
   String get completion => 'call()';
 }
 
-
 /// The information about a candidate suggestion based on a getter.
 final class GetterSuggestion extends ImportableSuggestion
     with MemberSuggestion {
@@ -502,7 +504,7 @@
   final String? prefix;
 
   /// Initialize data representing an import of a library, using the
-  /// [libraryUriStr], with the [prefix].
+  /// [libraryUri], with the [prefix].
   ImportData({
     required this.libraryUri,
     required this.prefix,
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index c8796be..7b96172 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -2,6 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+/// @docImport 'package:analysis_server/src/lsp/handlers/handler_completion.dart';
+library;
+
 import 'package:analysis_server/src/computer/computer_documentation.dart';
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/provisional/completion/completion_core.dart';
@@ -78,9 +81,8 @@
   /// with the import index property updated.
   final NotImportedSuggestions? notImportedSuggestions;
 
-  /// Whether the number of suggestions initallly computed was
-  /// greater than the [maxSuggestions] for a given request, and they were
-  /// truncated to fit.
+  /// Whether the number of suggestions initallly computed was greater than the
+  /// `maxSuggestions` for a given request, and they were truncated to fit.
   bool isTruncated = false;
 
   DartCompletionManager({
@@ -271,10 +273,11 @@
   /// Return the source in which the completion is being requested.
   final Source source;
 
-  /// Return the completion target.  This determines what part of the parse tree
-  /// will receive the newly inserted text.
-  /// At a minimum, all declarations in the completion scope in [target.unit]
-  /// will be resolved if they can be resolved.
+  /// The completion target.
+  ///
+  /// This determines what part of the parse tree will receive the newly
+  /// inserted text. At a minimum, all declarations in the completion scope in
+  /// `target.unit` will be resolved if they can be resolved.
   final CompletionTarget target;
 
   /// The compilation unit in which completion is being requested.
@@ -501,7 +504,7 @@
   }
 }
 
-/// Information provided by [NotImportedContributor] in addition to suggestions.
+/// Information provided by [CompletionHandler]s in addition to suggestions.
 class NotImportedSuggestions {
   /// This flag is set to `true` if the contributor decided to stop before it
   /// processed all available libraries, e.g. we ran out of budget.
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart b/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart
index c0f5147..75cd943 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart
@@ -664,7 +664,7 @@
   }
 
   /// Adds suggestions for any constructors that are visible through type
-  /// aliases declared within the [library].
+  /// aliases declared within the `importData.libraryUri`.
   void _addConstructorsForAliasedElement(
     TypeAliasElement2 alias,
     ImportData? importData,
@@ -1345,8 +1345,8 @@
     }
   }
 
-  /// Add the static [accessors], [constructors], [fields], and [methods]
-  /// defined by the [containingElement].
+  /// Adds the static [getters], [setters], [constructors], [fields], and
+  /// [methods] defined by the [containingElement].
   void _addStaticMembers({
     required List<GetterElement> getters,
     required List<SetterElement> setters,
@@ -1582,8 +1582,7 @@
     return null;
   }
 
-  /// Adds a suggestion for the class represented by the [element]. The [prefix]
-  /// is the prefix by which the element is imported.
+  /// Adds a suggestion for the class represented by the [element].
   void _suggestClass(ClassElement2 element, ImportData? importData) {
     if (visibilityTracker.isVisible(element: element, importData: importData)) {
       if ((mustBeExtendable &&
@@ -1615,8 +1614,7 @@
     }
   }
 
-  /// Adds a suggestion for the constructor represented by the [element]. The
-  /// [prefix] is the prefix by which the class is imported.
+  /// Adds a suggestion for the constructor represented by the [element].
   void _suggestConstructor(
     ConstructorElement2 element, {
     required ImportData? importData,
@@ -1694,8 +1692,7 @@
     }
   }
 
-  /// Adds a suggestion for the enum represented by the [element]. The [prefix]
-  /// is the prefix by which the element is imported.
+  /// Adds a suggestion for the enum represented by the [element].
   void _suggestEnum(EnumElement2 element, ImportData? importData) {
     if (visibilityTracker.isVisible(element: element, importData: importData)) {
       if (mustBeExtendable || mustBeImplementable || mustBeMixable) {
@@ -1722,8 +1719,7 @@
     }
   }
 
-  /// Adds a suggestion for the extension represented by the [element]. The
-  /// [prefix] is the prefix by which the element is imported.
+  /// Adds a suggestion for the extension represented by the [element].
   void _suggestExtension(ExtensionElement2 element, ImportData? importData) {
     if (visibilityTracker.isVisible(element: element, importData: importData)) {
       if (mustBeExtendable || mustBeImplementable || mustBeMixable) {
@@ -1744,8 +1740,7 @@
     }
   }
 
-  /// Adds a suggestion for the extension type represented by the [element]. The
-  /// [prefix] is the prefix by which the element is imported.
+  /// Adds a suggestion for the extension type represented by the [element].
   void _suggestExtensionType(
     ExtensionTypeElement2 element,
     ImportData? importData,
@@ -1879,8 +1874,7 @@
     }
   }
 
-  /// Adds a suggestion for the mixin represented by the [element]. The [prefix]
-  /// is the prefix by which the element is imported.
+  /// Adds a suggestion for the mixin represented by the [element].
   void _suggestMixin(MixinElement2 element, ImportData? importData) {
     if (visibilityTracker.isVisible(element: element, importData: importData)) {
       if (mustBeExtendable ||
@@ -2095,8 +2089,7 @@
     }
   }
 
-  /// Adds a suggestion for the function represented by the [element]. The
-  /// [prefix] is the prefix by which the element is imported.
+  /// Adds a suggestion for the function represented by the [element].
   void _suggestTopLevelFunction(
     TopLevelFunctionElement element,
     ImportData? importData,
@@ -2122,7 +2115,6 @@
   }
 
   /// Adds a suggestion for the getter or setter represented by the [element].
-  /// The [prefix] is the prefix by which the element is imported.
   void _suggestTopLevelProperty(
     PropertyAccessorElement2 element,
     ImportData? importData,
@@ -2151,7 +2143,6 @@
   }
 
   /// Adds a suggestion for the getter or setter represented by the [element].
-  /// The [prefix] is the prefix by which the element is imported.
   void _suggestTopLevelVariable(
     TopLevelVariableElement2 element,
     ImportData? importData,
@@ -2174,8 +2165,7 @@
     }
   }
 
-  /// Adds a suggestion for the type alias represented by the [element]. The
-  /// [prefix] is the prefix by which the element is imported.
+  /// Adds a suggestion for the type alias represented by the [element].
   void _suggestTypeAlias(TypeAliasElement2 element, ImportData? importData) {
     if (visibilityTracker.isVisible(element: element, importData: importData)) {
       var matcherScore = state.matcher.score(element.displayName);
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
index bb056ae..aa9056d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart
@@ -1314,9 +1314,7 @@
     return null;
   }
 
-  /// Return the result of visiting the parent of the [node] after setting the
-  /// [childNode] to the [node]. Note that this method is destructive in that it
-  /// does not reset the [childNode] before returning.
+  /// Returns the result of visiting the parent of the [node].
   DartType? _visitParent(AstNode node) {
     var parent = node.parent;
     if (parent == null) {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/relevance_computer.dart b/pkg/analysis_server/lib/src/services/completion/dart/relevance_computer.dart
index 2cdadfd..67ec137 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/relevance_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/relevance_computer.dart
@@ -65,7 +65,7 @@
     return _cachedContainingMemberName;
   }
 
-  /// Compute the relevance for [FieldElement] suggestion.
+  /// Compute the relevance for [FieldElement2] suggestion.
   int computeFieldElementRelevance(
     FieldElement2 element,
     double inheritanceDistance,
@@ -420,7 +420,7 @@
     );
   }
 
-  /// Compute the relevance for [ConstructorElement].
+  /// Compute the relevance for [ConstructorElement2].
   int _computeConstructorRelevance(
     ConstructorElement2 element,
     NeverType neverType,
@@ -564,7 +564,7 @@
     );
   }
 
-  /// Compute the relevance for [MethodElement].
+  /// Compute the relevance for [MethodElement2].
   int _computeMethodRelevance(
     MethodElement2 method,
     double inheritanceDistance,
@@ -605,7 +605,7 @@
     );
   }
 
-  /// Compute the relevance for [PropertyAccessorElement].
+  /// Compute the relevance for [PropertyAccessorElement2].
   int _computePropertyAccessorRelevance(
     PropertyAccessorElement2 accessor,
     double inheritanceDistance,
@@ -639,7 +639,7 @@
     return 0;
   }
 
-  /// Compute the relevance for a static [FieldElement].
+  /// Compute the relevance for a static [FieldElement2].
   int _computeStaticFieldRelevance(
     FieldElement2 element,
     double inheritanceDistance,
@@ -663,7 +663,7 @@
     return 0;
   }
 
-  /// Compute the relevance for top level [PropertyAccessorElement].
+  /// Compute the relevance for top level [PropertyAccessorElement2].
   int _computeTopLevelPropertyAccessorRelevance(
     PropertyAccessorElement2 accessor,
     bool isNotImportedLibrary,
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index ce29aad..89c21ef 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -67,7 +67,7 @@
   /// URIs that should be imported (that are not already) for all types in the
   /// completion.
   ///
-  /// Includes a [URI] for [libraryUriStr] only if the items being suggested are
+  /// Includes a [Uri] for [libraryUriStr] only if the items being suggested are
   /// not already imported.
   List<Uri> requiredImports = const [];
 
@@ -273,11 +273,10 @@
     }
   }
 
-  /// Add a suggestion for a [field]. If the field is being referenced with a
-  /// target of `super`, then the [containingMemberName] should be the name of
-  /// the member containing the reference. The [inheritanceDistance] is the
-  /// value of the inheritance distance feature computed for the field (or
-  /// `-1.0` if the field is a static field).
+  /// Adds a suggestion for a [field].
+  ///
+  /// The [inheritanceDistance] is the value of the inheritance distance feature
+  /// computed for the field (or `-1.0` if the field is a static field).
   void suggestField(
     FieldElement2 field, {
     required double inheritanceDistance,
@@ -388,12 +387,10 @@
     );
   }
 
-  /// Add a suggestion for an [getter] declared within a class or extension.
-  /// If the accessor is being invoked with a target of `super`, then the
-  /// [containingMemberName] should be the name of the member containing the
-  /// invocation. The [inheritanceDistance] is the value of the inheritance
-  /// distance feature computed for the accessor or `-1.0` if the accessor is a
-  /// static accessor.
+  /// Adds a suggestion for an [getter] declared within a class or extension.
+  ///
+  /// The [inheritanceDistance] is the value of the inheritance distance feature
+  /// computed for the accessor or `-1.0` if the accessor is a static accessor.
   void suggestGetter(
     GetterElement getter, {
     required double inheritanceDistance,
@@ -775,7 +772,7 @@
     );
   }
 
-  /// Add a suggestion to replace the [targetId] with an override of the given
+  /// Add a suggestion to replace the `targetId` with an override of the given
   /// [element]. If [invokeSuper] is `true`, then the override will contain an
   /// invocation of an overridden member.
   Future<void> suggestOverride({
@@ -930,12 +927,10 @@
     );
   }
 
-  /// Add a suggestion for an [setter] declared within a class or extension.
-  /// If the accessor is being invoked with a target of `super`, then the
-  /// [containingMemberName] should be the name of the member containing the
-  /// invocation. The [inheritanceDistance] is the value of the inheritance
-  /// distance feature computed for the accessor or `-1.0` if the accessor is a
-  /// static accessor.
+  /// Adds a suggestion for an [setter] declared within a class or extension.
+  ///
+  /// The [inheritanceDistance] is the value of the inheritance distance feature
+  /// computed for the accessor or `-1.0` if the accessor is a static accessor.
   void suggestSetter(
     SetterElement setter, {
     required double inheritanceDistance,
@@ -1392,13 +1387,14 @@
     return j == targetPrefixLower.length;
   }
 
-  /// Return a [CompletionSuggestionBuilder] based on the [element], or `null`
-  /// if the element cannot be suggested. If the completion should be something
-  /// different than the name of the element, then the [completion] should be
-  /// supplied. If an [elementKind] is provided, then it will be used rather
-  /// than the kind normally used for the element. If a [prefix] is provided,
-  /// then the element name (or completion) will be prefixed. The [relevance] is
-  /// the relevance of the suggestion.
+  /// Returns a [CompletionSuggestionBuilder] based on the [element], or `null`
+  /// if the element cannot be suggested.
+  ///
+  /// If the completion should be something different than the name of the
+  /// element, then the [completion] should be supplied. If a [kind] is
+  /// provided, then it will be used rather than the kind normally used for the
+  /// element. If a [prefix] is provided, then the element name (or completion)
+  /// will be prefixed. The [relevance] is the relevance of the suggestion.
   CompletionSuggestionBuilder? _createCompletionSuggestionBuilder(
     Element2 element, {
     String? completion,
@@ -1428,13 +1424,14 @@
     );
   }
 
-  /// Return a [CompletionSuggestionBuilder] based on the [element], or `null`
-  /// if the element cannot be suggested. If the completion should be something
-  /// different than the name of the element, then the [completion] should be
-  /// supplied. If an [elementKind] is provided, then it will be used rather
-  /// than the kind normally used for the element. If a [prefix] is provided,
-  /// then the element name (or completion) will be prefixed. The [relevance] is
-  /// the relevance of the suggestion.
+  /// Returns a [CompletionSuggestionBuilder] based on the [element], or `null`
+  /// if the element cannot be suggested.
+  ///
+  /// If the completion should be something different than the name of the
+  /// element, then the [completion] should be supplied. If a [kind] is
+  /// provided, then it will be used rather than the kind normally used for the
+  /// element. If a [prefix] is provided, then the element name (or completion)
+  /// will be prefixed. The [relevance] is the relevance of the suggestion.
   CompletionSuggestionBuilder? _createCompletionSuggestionBuilder2(
     Element2 element, {
     String? completion,
@@ -1464,7 +1461,6 @@
     );
   }
 
-  /// The non-caching implementation of [_getElementCompletionData].
   _ElementCompletionData _createElementCompletionData(Element2 element) {
     var documentation = _getDocumentation(element);
 
@@ -1725,7 +1721,7 @@
 }
 
 /// The implementation of [CompletionSuggestionBuilder] that is based on
-/// [ElementCompletionData] and location specific information.
+/// [_ElementCompletionData] and location specific information.
 class _CompletionSuggestionBuilderImpl implements CompletionSuggestionBuilder {
   final Element2 orgElement;
   final SuggestionBuilder suggestionBuilder;
@@ -1799,7 +1795,7 @@
   }
 }
 
-/// Information about an [Element] that does not depend on the location where
+/// Information about an [Element2] that does not depend on the location where
 /// this element is suggested. For some often used elements, such as classes,
 /// it might be cached, so created only once.
 class _ElementCompletionData {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart b/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart
index b6f9093..acd7835 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart
@@ -229,12 +229,11 @@
   );
 }
 
-/// Returns true if the [parameter] is part of a constructor for a Flutter
-/// [Widget].
+/// Returns whether the [parameter] is part of a constructor for a Flutter
+/// `Widget`.
 bool isFlutterWidgetParameter(FormalParameterElement parameter) {
   var element = parameter.enclosingElement2;
-  if (element is ConstructorElement2 &&
-      element.enclosingElement2.isWidget) {
+  if (element is ConstructorElement2 && element.enclosingElement2.isWidget) {
     return true;
   }
   return false;
diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart b/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart
index 949c320..8a88a7d 100644
--- a/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart
@@ -158,7 +158,7 @@
   final Map<String, Producer> _children;
 
   /// Initialize a location whose valid values are the keys of a map as encoded
-  /// by the map of [children].
+  /// by the map of [_children].
   const MapProducer(this._children);
 
   @override