[messages] Get rid of deprecatedSnakeCaseNames.
The only remaining deprecated snake-case name was
`ParserErrorCode.UNEXPECTED_TOKEN`, which is no longer being used by
`package:dart_style`.
Note that the commit that removed `package:dart_style`'s use of
`ParserErrorCode.UNEXPECTED_TOKEN`
(https://github.com/dart-lang/dart_style/commit/ade6076f731c39306e3dd32608dfd00622e4492f)
was also the commit that bumped `package:dart_style`'s pubspec
dependency to permit analyzer versions >= `9.0.0`. Since the current
version of `package:analyzer` is `9.0.1-dev`, this means that `pub
get` will never pair a future version of `dart:analyzer` with a
version of `package:dart_style` that uses
`ParserErrorCode.UNEXPECTED_TOKEN`, so this removal is safe.
Change-Id: I6a6a6964a6e1dde6d8c1f1420b39f998b8a4073a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462322
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
index 6e47f41..d2275de 100644
--- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
+++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart
@@ -1116,9 +1116,6 @@
static const DiagnosticWithoutArguments typeParameterOnOperator =
diag.typeParameterOnOperator;
- @Deprecated("Please use unexpectedToken")
- static const DiagnosticCode UNEXPECTED_TOKEN = unexpectedToken;
-
/// Parameters:
/// Object p0: the starting character that was missing
static const DiagnosticWithArguments<
diff --git a/pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart b/pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart
index 7401e22..104bb8e 100644
--- a/pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart
+++ b/pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart
@@ -16094,9 +16094,6 @@
expectedTypes: [ExpectedType.string],
);
-@Deprecated("Please use unexpectedToken")
-const DiagnosticCode UNEXPECTED_TOKEN = unexpectedToken;
-
/// No parameters.
const DiagnosticWithoutArguments
unexpectedDollarInString = DiagnosticWithoutArgumentsImpl(
diff --git a/pkg/analyzer_utilities/lib/analyzer_messages.dart b/pkg/analyzer_utilities/lib/analyzer_messages.dart
index 6dbfc27..7856f34 100644
--- a/pkg/analyzer_utilities/lib/analyzer_messages.dart
+++ b/pkg/analyzer_utilities/lib/analyzer_messages.dart
@@ -81,9 +81,6 @@
file: syntacticErrorsFile,
name: 'ParserErrorCode',
type: AnalyzerDiagnosticType.syntacticError,
- deprecatedSnakeCaseNames: {
- 'UNEXPECTED_TOKEN', // Referenced by `package:dart_style`.
- },
),
DiagnosticClassInfo(
file: manifestWarningCodeFile,
@@ -584,11 +581,6 @@
/// The type of diagnostics in this class.
final AnalyzerDiagnosticType type;
- /// The names of any diagnostics which are relied upon by analyzer clients,
- /// and therefore will need their "snake case" form preserved (with a
- /// deprecation notice) after migration to camel case diagnostic codes.
- final Set<String> deprecatedSnakeCaseNames;
-
/// Documentation comment to generate for the diagnostic class.
///
/// If no documentation comment is needed, this should be the empty string.
@@ -598,7 +590,6 @@
required this.file,
required this.name,
required this.type,
- this.deprecatedSnakeCaseNames = const {},
this.comment = '',
});
@@ -742,14 +733,6 @@
constant.writeln('expectedTypes: ${_computeExpectedTypes()},');
constant.writeln(');');
memberAccumulator.constants[constantName] = constant.toString();
-
- if (diagnosticClassInfo.deprecatedSnakeCaseNames.contains(diagnosticCode)) {
- memberAccumulator.constants[diagnosticCode] =
- '''
-@Deprecated("Please use $constantName")
-const DiagnosticCode $diagnosticCode = $constantName;
-''';
- }
}
/// Generates doc comments for this error code.
@@ -799,21 +782,12 @@
/// diagnostic, imported from `diagnostic.g.dart` using the import prefix
/// `diag`.
void toAnalyzerRedirectCode({required MemberAccumulator memberAccumulator}) {
- var diagnosticCode = analyzerCode.snakeCaseName;
var ConstantStyle(:staticType) = constantStyle;
var constant = StringBuffer();
outputConstantHeader(constant);
constant.writeln(' static const $staticType $constantName =');
constant.writeln(' diag.$constantName;');
memberAccumulator.constants[constantName] = constant.toString();
-
- if (diagnosticClassInfo.deprecatedSnakeCaseNames.contains(diagnosticCode)) {
- memberAccumulator.constants[diagnosticCode] =
- '''
- @Deprecated("Please use $constantName")
- static const DiagnosticCode $diagnosticCode = $constantName;
-''';
- }
}
/// Generates the appropriate declaration for this diagnostic to include in