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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1302333005: Shift AnalysisError instances only once during incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 5feaaa9558837b31161f9cadc6a81e48c331f5c5..3e4cc5438322320d5befbd068222edfb5bfceec0 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -896,6 +896,11 @@ class IncrementalResolver {
int _updateDelta;
+ /**
+ * The set of [AnalysisError]s that have been already shifted.
+ */
+ Set<AnalysisError> _alreadyShiftedErrors = new HashSet.identity();
+
RecordingErrorListener errorListener = new RecordingErrorListener();
ResolutionContext _resolutionContext;
@@ -1146,9 +1151,11 @@ class IncrementalResolver {
void _shiftErrors(List<AnalysisError> errors) {
for (AnalysisError error in errors) {
- int errorOffset = error.offset;
- if (errorOffset > _updateOffset) {
- error.offset += _updateDelta;
+ if (_alreadyShiftedErrors.add(error)) {
+ int errorOffset = error.offset;
+ if (errorOffset > _updateOffset) {
+ error.offset += _updateDelta;
+ }
}
}
}
« 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