Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 3004443002: Skip errors that cannot be resynthesized. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 7b985333ef123675b6b455e343776b479c6596ab..9c3117a88493ab19387d709e77740ac5a9460a84 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -1215,28 +1215,28 @@ class AnalysisDriver implements AnalysisDriverGeneric {
}
/**
- * Return [AnalysisError]s for the given [serialized] errors.
+ * Return [AnalysisError]s for the given [serializedErrors].
*/
List<AnalysisError> _getErrorsFromSerialized(
- FileState file, List<AnalysisDriverUnitError> serialized) {
- return serialized.map((error) {
- String errorName = error.uniqueName;
+ FileState file, List<AnalysisDriverUnitError> serializedErrors) {
+ List<AnalysisError> errors = <AnalysisError>[];
+ for (AnalysisDriverUnitError serializedError in serializedErrors) {
+ String errorName = serializedError.uniqueName;
ErrorCode errorCode =
errorCodeByUniqueName(errorName) ?? _lintCodeByUniqueName(errorName);
- if (errorCode == null) {
- // This could fail because the error code is no longer defined, or, in
- // the case of a lint rule, if the lint rule has been disabled since the
- // errors were written.
- throw new StateError('No ErrorCode for $errorName in $file');
+ if (errorCode != null) {
+ errors.add(new AnalysisError.forValues(
+ file.source,
+ serializedError.offset,
+ serializedError.length,
+ errorCode,
+ serializedError.message,
+ serializedError.correction.isEmpty
+ ? null
+ : serializedError.correction));
}
- return new AnalysisError.forValues(
- file.source,
- error.offset,
- error.length,
- errorCode,
- error.message,
- error.correction.isEmpty ? null : error.correction);
- }).toList();
+ }
+ return errors;
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698