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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseFileTask.java

Issue 10389074: Cache unresolved units separately from libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseFileTask.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseFileTask.java (revision 7495)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseFileTask.java (working copy)
@@ -46,16 +46,27 @@
if (!dartFile.exists()) {
return;
}
+
+ // Don't parse sourced files without first parsing the library file
+ // because we need import prefixes for DartC to parse correctly
+
Library library = context.getCachedLibrary(libraryFile);
if (library == null) {
return;
}
- DartUnit dartUnit = library.getCachedUnit(dartFile);
- if (dartUnit != null) {
+
+ // Parse the file if it is not cached
+
+ DartUnit unit = library.getResolvedUnit(dartFile);
+ if (unit != null) {
return;
}
+ unit = context.getUnresolvedUnit(dartFile);
+ if (unit != null) {
+ return;
+ }
Set<String> prefixes = library.getPrefixes();
- dartUnit = parse(server, libraryFile, library.getLibrarySource(), dartFile, prefixes);
- library.cacheUnit(dartFile, dartUnit);
+ unit = parse(server, libraryFile, library.getLibrarySource(), dartFile, prefixes);
+ context.cacheUnresolvedUnit(dartFile, unit);
}
}

Powered by Google App Engine
This is Rietveld 408576698