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

Unified Diff: pkg/analyzer/lib/src/analyzer_impl.dart

Issue 202633002: Collect analysis errors from change notifications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/analyzer_impl.dart
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index 4a80e44f5db55fbdf36f53251cea6eb30e533ad4..efc97a1bd314fe873c98377ac363b45e02914d39 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -20,6 +20,8 @@ import 'generated/sdk_io.dart';
import 'generated/source_io.dart';
import '../options.dart';
+import 'dart:collection';
+
import 'package:analyzer/src/generated/java_core.dart' show JavaSystem;
import 'package:analyzer/src/error_formatter.dart';
@@ -47,6 +49,9 @@ class AnalyzerImpl {
/// All [AnalysisErrorInfo]s in the analyzed library.
final List<AnalysisErrorInfo> errorInfos = new List<AnalysisErrorInfo>();
+ /// [HashMap] between sources and analysis error infos.
+ final HashMap<Source, AnalysisErrorInfo> sourceErrorsMap = new HashMap<Source, AnalysisErrorInfo>();
+
AnalyzerImpl(this.sourcePath, this.options, this.startTime) {
if (sdk == null) {
sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath));
@@ -129,6 +134,7 @@ class AnalyzerImpl {
// again to perform next task
for (ChangeNotice notice in notices) {
sources.add(notice.source);
+ sourceErrorsMap[notice.source] = notice;
}
return _analyzeAsync();
}
@@ -137,7 +143,9 @@ class AnalyzerImpl {
// numbers.
//
// prepare errors
- prepareErrors();
+ sourceErrorsMap.forEach((k,v) {
+ errorInfos.add(sourceErrorsMap[k]);
+ });
// print errors and performance numbers
_printErrorsAndPerf();
« 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