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

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

Issue 2808173002: Prioritize analysis of files that import the changed file, or have an error or warning. (Closed)
Patch Set: Created 3 years, 8 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
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 871be4cfb0407f41a110328e54ddabf2f5db7c85..a501db5653923f60ab66b0985ffdf509aae17759 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -1086,6 +1086,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
{String content, CompilationUnit resolvedUnit}) {
var unit = new AnalysisDriverResolvedUnit.fromBuffer(bytes);
List<AnalysisError> errors = _getErrorsFromSerialized(file, unit.errors);
+ _updateHasErrorOrWarningFlag(file, errors);
return new AnalysisResult(
this,
_sourceFactory,
@@ -1242,6 +1243,23 @@ class AnalysisDriver implements AnalysisDriverGeneric {
return null;
}
}
+
+ /**
+ * Given the list of [errors] for the [file], update the [file]'s
+ * [FileState.hasErrorOrWarning] flag.
+ */
+ void _updateHasErrorOrWarningFlag(
+ FileState file, List<AnalysisError> errors) {
+ for (AnalysisError error in errors) {
+ ErrorSeverity severity = error.errorCode.errorSeverity;
+ if (severity == ErrorSeverity.ERROR ||
+ severity == ErrorSeverity.WARNING) {
+ file.hasErrorOrWarning = true;
+ return;
+ }
+ }
+ file.hasErrorOrWarning = false;
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698