Remove some unnecessary ignore comments in analyzer packages

Change-Id: I578285132f0d3f200cb2e9069750a1391940711d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart b/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart
index b066cdf..4a20903 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/token_stream_rewriter.dart
@@ -82,7 +82,6 @@
       throw 'Internal Error: Rewriting at eof.';
     }
 
-    // ignore:unnecessary_null_comparison
     assert(endGroup.beforeSynthetic != null);
     if (token == endGroup) return endGroup;
     Token? errorToken;
diff --git a/pkg/_fe_analyzer_shared/lib/src/util/colors.dart b/pkg/_fe_analyzer_shared/lib/src/util/colors.dart
index af78689..3882e59 100644
--- a/pkg/_fe_analyzer_shared/lib/src/util/colors.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/util/colors.dart
@@ -109,7 +109,6 @@
 /// determined.
 bool? _supportsAnsiEscapes(sink) {
   try {
-    // ignore: undefined_getter
     return sink.supportsAnsiEscapes;
   } on NoSuchMethodError {
     // Ignored: We're running on an older version of the Dart VM which doesn't
diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart
index 3b76a6e..8cc4eba 100644
--- a/pkg/analysis_server/lib/protocol/protocol_constants.dart
+++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 const String PROTOCOL_VERSION = '1.33.4';
 
 const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart
index e63a02c..387f244 100644
--- a/pkg/analysis_server/lib/protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'dart:convert' hide JsonDecoder;
 
 import 'package:analysis_server/protocol/protocol.dart';
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
index dfe382eb..f413435 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_type_definition.dart
@@ -33,7 +33,6 @@
   @override
   // The private type in the return type is dictated by the signature of the
   // super-method and the class's super-class.
-  // ignore: library_private_types_in_public_api
   Future<ErrorOr<TextDocumentTypeDefinitionResult>> handle(
       TypeDefinitionParams params,
       MessageInfo message,
diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
index 549c0ca..c928935 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_error_code.dart
@@ -2,183 +2,136 @@
 // 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.
 
-// ignore_for_file: prefer_single_quotes, slash_for_doc_comments
 import 'package:analyzer/error/error.dart';
 
 /// An error code representing a problem in a file containing an encoding of a
 /// transform set.
 class TransformSetErrorCode extends ErrorCode {
-  /**
-   * Parameters:
-   * 0: the conflicting key
-   * 1: the key that it conflicts with
-   */
+  /// Parameters:
+  /// 0: the conflicting key
+  /// 1: the key that it conflicts with
   static const TransformSetErrorCode conflictingKey = TransformSetErrorCode(
       'conflicting_key',
       "The key '{0}' can't be used when '{1}' is also used.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode expectedPrimary = TransformSetErrorCode(
       'expected_primary', "Expected either an identifier or a string literal.");
 
-  /**
-   * Parameters:
-   * 0: the old kind
-   * 1: the new kind
-   */
+  /// Parameters:
+  /// 0: the old kind
+  /// 1: the new kind
   static const TransformSetErrorCode incompatibleElementKind =
       TransformSetErrorCode(
           'incompatible_element_kind',
           "An element of kind '{0}' can't be replaced by "
               "an element of kind '{1}'.");
 
-  /**
-   * Parameters:
-   * 0: the change kind that is invalid
-   * 1: the element kind for the transform
-   */
+  /// Parameters:
+  /// 0: the change kind that is invalid
+  /// 1: the element kind for the transform
   static const TransformSetErrorCode invalidChangeForKind =
       TransformSetErrorCode('invalid_change_for_kind',
           "A change of type '{0}' can't be used for an element of kind '{1}'.");
 
-  /**
-   * Parameters:
-   * 0: the character that is invalid
-   */
+  /// Parameters:
+  /// 0: the character that is invalid
   static const TransformSetErrorCode invalidCharacter =
       TransformSetErrorCode('invalid_character', "Invalid character '{0}'.");
 
-  /**
-   * Parameters:
-   * 0: the actual type of the key
-   */
+  /// Parameters:
+  /// 0: the actual type of the key
   static const TransformSetErrorCode invalidKey = TransformSetErrorCode(
       'invalid_key', "Keys must be of type 'String' but found the type '{0}'.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode invalidRequiredIf = TransformSetErrorCode(
       'invalid_required_if',
       "The key 'requiredIf' can only be used with optional named parameters.");
 
-  /**
-   * Parameters:
-   * 0: the key with which the value is associated
-   * 1: the expected type of the value
-   * 2: the actual type of the value
-   */
+  /// Parameters:
+  /// 0: the key with which the value is associated
+  /// 1: the expected type of the value
+  /// 2: the actual type of the value
   static const TransformSetErrorCode invalidValue = TransformSetErrorCode(
       'invalid_value',
       "The value of '{0}' should be of type '{1}' but is of type '{2}'.");
 
-  /**
-   * Parameters:
-   * 0: the list of valid parameter styles
-   */
+  /// Parameters:
+  /// 0: the list of valid parameter styles
   static const TransformSetErrorCode invalidParameterStyle =
       TransformSetErrorCode('invalid_parameter_style',
           "The parameter style must be one of the following: {0}.");
 
-  /**
-   * Parameters:
-   * 0: the key with which the value is associated
-   * 1: the allowed values as a comma-separated list
-   */
+  /// Parameters:
+  /// 0: the key with which the value is associated
+  /// 1: the allowed values as a comma-separated list
   static const TransformSetErrorCode invalidValueOneOf = TransformSetErrorCode(
       'invalid_value_one_of',
       "The value of '{0}' must be one of the following: '{1}'.");
 
-  /**
-   * Parameters:
-   * 0: the missing key
-   */
+  /// Parameters:
+  /// 0: the missing key
   static const TransformSetErrorCode missingKey =
       TransformSetErrorCode('missing_key', "Missing the required key '{0}'.");
 
-  /**
-   * Parameters:
-   * 0: the list of valid keys
-   */
+  /// Parameters:
+  /// 0: the list of valid keys
   static const TransformSetErrorCode missingOneOfMultipleKeys =
       TransformSetErrorCode('missing_one_of_multiple_keys',
           "Exactly one of the following keys must be provided: {0}.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode missingTemplateEnd = TransformSetErrorCode(
       'missing_template_end', "Missing the end brace for the template.");
 
-  /**
-   * Parameters:
-   * 0: a description of the expected kinds of tokens
-   */
+  /// Parameters:
+  /// 0: a description of the expected kinds of tokens
   static const TransformSetErrorCode missingToken =
       TransformSetErrorCode('missing_token', "Expected to find {0}.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode missingUri = TransformSetErrorCode(
       'missing_uri', "At least one URI must be provided.");
 
-  /**
-   * Parameters:
-   * 0: the missing key
-   */
+  /// Parameters:
+  /// 0: the missing key
   static const TransformSetErrorCode undefinedVariable = TransformSetErrorCode(
       'undefined_variable', "The variable '{0}' isn't defined.");
 
-  /**
-   * Parameters:
-   * 0: the token that was unexpectedly found
-   */
+  /// Parameters:
+  /// 0: the token that was unexpectedly found
   static const TransformSetErrorCode unexpectedToken =
       TransformSetErrorCode('unexpected_token', "Didn't expect to find {0}.");
 
-  /**
-   * Parameters:
-   * 0: a description of the expected kind of token
-   */
+  /// Parameters:
+  /// 0: a description of the expected kind of token
   static const TransformSetErrorCode unknownAccessor = TransformSetErrorCode(
       'unknown_accessor', "The accessor '{0}' is invalid.");
 
-  /**
-   * Parameters:
-   * 0: the unsupported key
-   */
+  /// Parameters:
+  /// 0: the unsupported key
   static const TransformSetErrorCode unsupportedKey = TransformSetErrorCode(
       'unsupported_key', "The key '{0}' isn't supported.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode unsupportedStatic = TransformSetErrorCode(
       'unsupported_static',
       "The key 'static' is only supported for elements in a class, enum, "
           "extension, or mixin.");
 
-  /**
-   * No parameters.
-   */
+  /// No parameters.
   static const TransformSetErrorCode unsupportedVersion = TransformSetErrorCode(
       'unsupported_version', "Only version '1' is supported at this time.");
 
-  /**
-   * Parameters:
-   * 0: a description of the expected kind of token
-   * 1: a description of the actual kind of token
-   */
+  /// Parameters:
+  /// 0: a description of the expected kind of token
+  /// 1: a description of the actual kind of token
   static const TransformSetErrorCode wrongToken = TransformSetErrorCode(
       'wrong_token', "Expected to find {0}, but found {1}.");
 
-  /**
-   * Parameters:
-   * 0: the message produced by the YAML parser
-   */
+  /// Parameters:
+  /// 0: the message produced by the YAML parser
   static const TransformSetErrorCode yamlSyntaxError =
       TransformSetErrorCode('yaml_syntax_error', "Parse error: {0}");
 
diff --git a/pkg/analysis_server/test/integration/support/integration_test_methods.dart b/pkg/analysis_server/test/integration/support/integration_test_methods.dart
index 1e6d434..ff18a9d 100644
--- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 /// Convenience methods for running integration tests.
 import 'dart:async';
 
diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
index 81fb802..7b60b54 100644
--- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 /// Matchers for data types defined in the analysis server API.
 import 'package:test/test.dart';
 
diff --git a/pkg/analysis_server_client/lib/handler/notification_handler.dart b/pkg/analysis_server_client/lib/handler/notification_handler.dart
index b71e1c6..2d8715a 100644
--- a/pkg/analysis_server_client/lib/handler/notification_handler.dart
+++ b/pkg/analysis_server_client/lib/handler/notification_handler.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'package:analysis_server_client/protocol.dart';
 
 /// [NotificationHandler] processes analysis server notifications
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
index 626781d..01225fe 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'dart:convert' hide JsonDecoder;
 
 import 'package:analysis_server_client/src/protocol/protocol_base.dart';
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
index 3b76a6e..8cc4eba 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 const String PROTOCOL_VERSION = '1.33.4';
 
 const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
index 4286136..5ba5def 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'dart:convert' hide JsonDecoder;
 
 import 'package:analysis_server_client/src/protocol/protocol_base.dart';
diff --git a/pkg/analyzer/lib/src/summary2/named_type_builder.dart b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
index 722a9c1..824cc53 100644
--- a/pkg/analyzer/lib/src/summary2/named_type_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
@@ -95,7 +95,6 @@
       return _type!;
     }
 
-    // ignore: unnecessary_this
     final element = this.element;
     if (element is InterfaceElement) {
       var parameters = element.typeParameters;
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
index b4f056b..d01918d 100644
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
@@ -204,8 +204,6 @@
   }
 }
 
-// TODO(srawlins): Re-enable?
-// ignore: unreachable_from_main
 class PubSuggestionCodeTest extends PubPackageResolutionTest {
   // TODO(brianwilkerson) The tests in this class are not being run, and all but
   //  the first would fail. We should implement these checks and enable the
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index 2958d55..52a63bf 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -23,8 +23,6 @@
   });
 }
 
-// TODO(srawlins): Re-enable?
-// ignore: unreachable_from_main
 class CharacterRangeReaderTest {
   void test_advance() {
     CharSequenceReader baseReader = CharSequenceReader("xyzzy");
diff --git a/pkg/analyzer/test/src/summary/elements_test.dart b/pkg/analyzer/test/src/summary/elements_test.dart
index 6734483..66aad72 100644
--- a/pkg/analyzer/test/src/summary/elements_test.dart
+++ b/pkg/analyzer/test/src/summary/elements_test.dart
@@ -22,8 +22,6 @@
 }
 
 @reflectiveTest
-// TODO(srawlins): Re-enable?
-// ignore: unreachable_from_main
 class ApplyCheckElementTextReplacements {
   test_applyReplacements() {
     applyCheckElementTextReplacements();
diff --git a/pkg/analyzer/test/src/summary/top_level_inference_test.dart b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
index e785f50..074b6e1 100644
--- a/pkg/analyzer/test/src/summary/top_level_inference_test.dart
+++ b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
@@ -19,8 +19,6 @@
 }
 
 @reflectiveTest
-// TODO(srawlins): Re-enable?
-// ignore: unreachable_from_main
 class ApplyCheckElementTextReplacements {
   test_applyReplacements() {
     applyCheckElementTextReplacements();
diff --git a/pkg/analyzer/test/src/utilities/extensions/collection_test.dart b/pkg/analyzer/test/src/utilities/extensions/collection_test.dart
index c530c63..0b0f9f2 100644
--- a/pkg/analyzer/test/src/utilities/extensions/collection_test.dart
+++ b/pkg/analyzer/test/src/utilities/extensions/collection_test.dart
@@ -28,8 +28,6 @@
 }
 
 @reflectiveTest
-// TODO(srawlins): Re-enable?
-// ignore: unreachable_from_main
 class SetExtensionTest {
   test_addIfNotNull_notNull() {
     var elements = {0, 1};
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
index 6405463..7f6bb07 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'dart:convert' hide JsonDecoder;
 
 import 'package:analyzer_plugin/protocol/protocol.dart';
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart
index d739d6b..51857ecf 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 const String ANALYSIS_NOTIFICATION_ERRORS = 'analysis.errors';
 const String ANALYSIS_NOTIFICATION_ERRORS_ERRORS = 'errors';
 const String ANALYSIS_NOTIFICATION_ERRORS_FILE = 'file';
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart
index edc73db..c43369c 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 import 'dart:convert' hide JsonDecoder;
 
 import 'package:analyzer_plugin/protocol/protocol.dart';
diff --git a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
index 2b6b316..25fbdb3 100644
--- a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
+++ b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 /// Convenience methods for running integration tests.
 import 'dart:async';
 
diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
index 0838868..9bae54e 100644
--- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
+++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
@@ -6,8 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
 
-// ignore_for_file: constant_identifier_names
-
 /// Matchers for data types defined in the analysis server API.
 import 'package:test/test.dart';
 
diff --git a/pkg/analyzer_utilities/lib/tools.dart b/pkg/analyzer_utilities/lib/tools.dart
index 79f022c..38abb6d 100644
--- a/pkg/analyzer_utilities/lib/tools.dart
+++ b/pkg/analyzer_utilities/lib/tools.dart
@@ -168,8 +168,6 @@
 // This file has been automatically generated. Please do not edit it manually.
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/spec/generate_files".
-
-// ignore_for_file: constant_identifier_names
 ''';
     }
     writeln(header.trim());