Skip to content

Commit e34d278

Browse files
stereotype441Commit Queue
authored andcommitted
[messages] Remove unused toYaml methods.
These methods were useful when I was first adding code generation logic for analyzer error codes, and so I was creating yaml files to act as the source for code generation. Now that the code generation logic is fully in place, there is no need for them anymore, and maintaining them was proving to be a pain. Change-Id: I6a6a69648498a4994fac4d814153b6500ec2978d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451823 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent f1405f9 commit e34d278

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

pkg/analyzer_utilities/lib/messages.dart

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,6 @@ abstract class CfeStyleErrorCodeInfo extends ErrorCodeInfo {
197197
}
198198
}
199199

200-
@override
201-
Map<Object?, Object?> toYaml() => {
202-
if (analyzerCodes.isNotEmpty)
203-
'analyzerCode': _encodeAnalyzerCode(analyzerCodes),
204-
if (index != null) 'index': index,
205-
...super.toYaml(),
206-
};
207-
208200
static List<String> _decodeAnalyzerCode(Object? value) {
209201
if (value == null) {
210202
return const [];
@@ -240,14 +232,6 @@ abstract class CfeStyleErrorCodeInfo extends ErrorCodeInfo {
240232
throw 'Bad severity type: ${yamlEntry.runtimeType}';
241233
}
242234
}
243-
244-
static Object _encodeAnalyzerCode(List<String> analyzerCode) {
245-
if (analyzerCode.length == 1) {
246-
return analyzerCode.single;
247-
} else {
248-
return analyzerCode;
249-
}
250-
}
251235
}
252236

253237
/// Information about how to convert the CFE's internal representation of a
@@ -603,18 +587,6 @@ static LocatableDiagnostic $withArgumentsName({$withArgumentsParams}) {
603587
return out.toString();
604588
}
605589

606-
/// Encodes this object into a YAML representation.
607-
Map<Object?, Object?> toYaml() => {
608-
if (removedIn != null) 'removedIn': removedIn,
609-
if (sharedName != null) 'sharedName': sharedName,
610-
'problemMessage': problemMessage,
611-
if (correctionMessage != null) 'correctionMessage': correctionMessage,
612-
if (isUnresolvedIdentifier) 'isUnresolvedIdentifier': true,
613-
if (hasPublishedDocs ?? false) 'hasPublishedDocs': true,
614-
if (comment != null) 'comment': comment,
615-
if (documentation != null) 'documentation': documentation,
616-
};
617-
618590
String _computeExpectedTypes() {
619591
var expectedTypes = [
620592
for (var parameter in parameters.values)

0 commit comments

Comments
 (0)