Skip to content

Commit 47e7793

Browse files
stereotype441Commit Queue
authored andcommitted
[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` (dart-lang/dart_style@ade6076) 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 <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 622e079 commit 47e7793

File tree

3 files changed

+0
-32
lines changed

3 files changed

+0
-32
lines changed

pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,6 @@ class ParserErrorCode {
11161116
static const DiagnosticWithoutArguments typeParameterOnOperator =
11171117
diag.typeParameterOnOperator;
11181118

1119-
@Deprecated("Please use unexpectedToken")
1120-
static const DiagnosticCode UNEXPECTED_TOKEN = unexpectedToken;
1121-
11221119
/// Parameters:
11231120
/// Object p0: the starting character that was missing
11241121
static const DiagnosticWithArguments<

pkg/analyzer/lib/src/diagnostic/diagnostic.g.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16094,9 +16094,6 @@ undone = DiagnosticWithArguments(
1609416094
expectedTypes: [ExpectedType.string],
1609516095
);
1609616096

16097-
@Deprecated("Please use unexpectedToken")
16098-
const DiagnosticCode UNEXPECTED_TOKEN = unexpectedToken;
16099-
1610016097
/// No parameters.
1610116098
const DiagnosticWithoutArguments
1610216099
unexpectedDollarInString = DiagnosticWithoutArgumentsImpl(

pkg/analyzer_utilities/lib/analyzer_messages.dart

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ const List<DiagnosticClassInfo> diagnosticClasses = [
8181
file: syntacticErrorsFile,
8282
name: 'ParserErrorCode',
8383
type: AnalyzerDiagnosticType.syntacticError,
84-
deprecatedSnakeCaseNames: {
85-
'UNEXPECTED_TOKEN', // Referenced by `package:dart_style`.
86-
},
8784
),
8885
DiagnosticClassInfo(
8986
file: manifestWarningCodeFile,
@@ -584,11 +581,6 @@ class DiagnosticClassInfo {
584581
/// The type of diagnostics in this class.
585582
final AnalyzerDiagnosticType type;
586583

587-
/// The names of any diagnostics which are relied upon by analyzer clients,
588-
/// and therefore will need their "snake case" form preserved (with a
589-
/// deprecation notice) after migration to camel case diagnostic codes.
590-
final Set<String> deprecatedSnakeCaseNames;
591-
592584
/// Documentation comment to generate for the diagnostic class.
593585
///
594586
/// If no documentation comment is needed, this should be the empty string.
@@ -598,7 +590,6 @@ class DiagnosticClassInfo {
598590
required this.file,
599591
required this.name,
600592
required this.type,
601-
this.deprecatedSnakeCaseNames = const {},
602593
this.comment = '',
603594
});
604595

@@ -742,14 +733,6 @@ LocatableDiagnostic $withArgumentsName({$withArgumentsParams}) {
742733
constant.writeln('expectedTypes: ${_computeExpectedTypes()},');
743734
constant.writeln(');');
744735
memberAccumulator.constants[constantName] = constant.toString();
745-
746-
if (diagnosticClassInfo.deprecatedSnakeCaseNames.contains(diagnosticCode)) {
747-
memberAccumulator.constants[diagnosticCode] =
748-
'''
749-
@Deprecated("Please use $constantName")
750-
const DiagnosticCode $diagnosticCode = $constantName;
751-
''';
752-
}
753736
}
754737

755738
/// Generates doc comments for this error code.
@@ -799,21 +782,12 @@ const DiagnosticCode $diagnosticCode = $constantName;
799782
/// diagnostic, imported from `diagnostic.g.dart` using the import prefix
800783
/// `diag`.
801784
void toAnalyzerRedirectCode({required MemberAccumulator memberAccumulator}) {
802-
var diagnosticCode = analyzerCode.snakeCaseName;
803785
var ConstantStyle(:staticType) = constantStyle;
804786
var constant = StringBuffer();
805787
outputConstantHeader(constant);
806788
constant.writeln(' static const $staticType $constantName =');
807789
constant.writeln(' diag.$constantName;');
808790
memberAccumulator.constants[constantName] = constant.toString();
809-
810-
if (diagnosticClassInfo.deprecatedSnakeCaseNames.contains(diagnosticCode)) {
811-
memberAccumulator.constants[diagnosticCode] =
812-
'''
813-
@Deprecated("Please use $constantName")
814-
static const DiagnosticCode $diagnosticCode = $constantName;
815-
''';
816-
}
817791
}
818792

819793
/// Generates the appropriate declaration for this diagnostic to include in

0 commit comments

Comments
 (0)