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

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

Issue 860903002: Invalidate parsing information when a file is added. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index b8449a503295f28feeb5ad02528e8cebcf783ae7..1f359318c29bebd6e6194ff81ff58e4090cfe4c5 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -1572,10 +1572,10 @@ class AnalysisContextImpl implements InternalAnalysisContext {
Source source = sourcesToInvalidate[i];
SourceEntry entry = _getReadableSourceEntry(source);
if (entry is DartEntry) {
- entry.invalidateAllResolutionInformation(false);
+ entry.invalidateParseInformation();
_workManager.add(source, _computePriority(entry));
} else if (entry is HtmlEntry) {
- entry.invalidateAllResolutionInformation(false);
+ entry.invalidateParseInformation();
_workManager.add(source, SourcePriority.HTML);
}
}
@@ -8155,6 +8155,18 @@ class DartEntry extends SourceEntry {
}
/**
+ * Invalidate all of the parse and resolution information associated with
+ * this source.
+ */
+ void invalidateParseInformation() {
+ setState(SOURCE_KIND, CacheState.INVALID);
+ setState(PARSE_ERRORS, CacheState.INVALID);
+ setState(PARSED_UNIT, CacheState.INVALID);
+ _containingLibraries.clear();
+ _discardCachedResolutionInformation(true);
+ }
+
+ /**
* Record that an [exception] occurred while attempting to build the element
* model for the source represented by this entry in the context of the given
* [library]. This will set the state of all resolution-based information as
@@ -9160,6 +9172,17 @@ class HtmlEntry extends SourceEntry {
}
}
+ /**
+ * Invalidate all of the parse and resolution information associated with
+ * this source.
+ */
+ void invalidateParseInformation() {
+ setState(PARSE_ERRORS, CacheState.INVALID);
+ setState(PARSED_UNIT, CacheState.INVALID);
+ setState(RESOLVED_UNIT, CacheState.INVALID);
Brian Wilkerson 2015/01/20 21:32:04 I would have expected the RESOLVED_UNIT to get inv
scheglov 2015/01/20 23:12:29 Done.
+ invalidateAllResolutionInformation(true);
+ }
+
@override
void recordContentError(CaughtException exception) {
super.recordContentError(exception);
« 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