@@ -16,6 +16,15 @@ import 'customized_codes.dart';
1616@Deprecated ("Use 'DiagnosticCode' instead." )
1717typedef ErrorCode = DiagnosticCode ;
1818
19+ /// The severity of a [DiagnosticCode] .
20+ @AnalyzerPublicApi (message: 'exported by package:analyzer/error/error.dart' )
21+ @Deprecated ("Use 'DiagnosticSeverity' instead." )
22+ typedef ErrorSeverity = DiagnosticSeverity ;
23+
24+ @AnalyzerPublicApi (message: 'exported by package:analyzer/error/error.dart' )
25+ @Deprecated ("Use 'DiagnosticType' instead." )
26+ typedef ErrorType = DiagnosticType ;
27+
1928/// An error code associated with an `AnalysisError` .
2029///
2130/// Generally, messages should follow the [Guide for Writing
@@ -75,26 +84,13 @@ abstract class DiagnosticCode {
7584 String ? get correctionMessage =>
7685 customizedCorrections[uniqueName] ?? _correctionMessage;
7786
78- /**
79- * The severity of the diagnostic.
80- */
81- DiagnosticSeverity get severity;
82-
8387 @Deprecated ("Use 'diagnosticSeverity' instead" )
8488 DiagnosticSeverity get errorSeverity => severity;
8589
8690 /// Whether a finding of this diagnostic is ignorable via comments such as
8791 /// `// ignore:` or `// ignore_for_file:` .
8892 bool get isIgnorable => severity != DiagnosticSeverity .ERROR ;
8993
90- /**
91- * The template used to create the problem message to be displayed for this
92- * diagnostic. The problem message should indicate what is wrong and why it is
93- * wrong.
94- */
95- String get problemMessage =>
96- customizedMessages[uniqueName] ?? _problemMessage;
97-
9894 int get numParameters {
9995 int result = 0 ;
10096 String ? correctionMessage = _correctionMessage;
@@ -109,6 +105,19 @@ abstract class DiagnosticCode {
109105 return result;
110106 }
111107
108+ /**
109+ * The template used to create the problem message to be displayed for this
110+ * diagnostic. The problem message should indicate what is wrong and why it is
111+ * wrong.
112+ */
113+ String get problemMessage =>
114+ customizedMessages[uniqueName] ?? _problemMessage;
115+
116+ /**
117+ * The severity of the diagnostic.
118+ */
119+ DiagnosticSeverity get severity;
120+
112121 /**
113122 * The type of the error.
114123 */
@@ -129,11 +138,6 @@ abstract class DiagnosticCode {
129138 String toString () => uniqueName;
130139}
131140
132- /// The severity of a [DiagnosticCode] .
133- @AnalyzerPublicApi (message: 'exported by package:analyzer/error/error.dart' )
134- @Deprecated ("Use 'DiagnosticSeverity' instead." )
135- typedef ErrorSeverity = DiagnosticSeverity ;
136-
137141/**
138142 * The severity of an [DiagnosticCode] .
139143 */
@@ -225,10 +229,6 @@ class DiagnosticSeverity implements Comparable<DiagnosticSeverity> {
225229 String toString () => name;
226230}
227231
228- @AnalyzerPublicApi (message: 'exported by package:analyzer/error/error.dart' )
229- @Deprecated ("Use 'DiagnosticType' instead." )
230- typedef ErrorType = DiagnosticType ;
231-
232232/**
233233 * The type of a [DiagnosticCode] .
234234 */
0 commit comments