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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 9836105: AnalysisServer fixes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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: compiler/java/com/google/dart/compiler/DartCompiler.java
===================================================================
--- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 5878)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -1160,16 +1160,26 @@
DartCompilerMainContext context = new DartCompilerMainContext(lib, provider, listener, config);
Compiler compiler = new SelectiveCompiler(lib, resolvedLibs, parsedUnits, config, context);
- compiler.updateAndResolve();
+ LibraryUnit topLibUnit = compiler.updateAndResolve();
+ Map<URI, LibraryUnit> librariesToResolve;
+ librariesToResolve = new HashMap<URI, LibraryUnit>();
+ librariesToResolve.put(topLibUnit.getSource().getUri(), topLibUnit);
+ // TODO (danrubel) revisit when AnalysisServer is turned on
+ // librariesToResolve.putAll(compiler.getLibraries());
+
DartCompilationPhase[] phases = {new Resolver.Phase(), new TypeAnalyzer()};
Map<URI, LibraryUnit> newLibraries = Maps.newHashMap();
- for (Entry<URI, LibraryUnit> entry : compiler.getLibraries().entrySet()) {
+ for (Entry<URI, LibraryUnit> entry : librariesToResolve.entrySet()) {
URI libUri = entry.getKey();
LibraryUnit libUnit = entry.getValue();
if (!resolvedLibs.containsKey(libUri) && libUnit != null) {
newLibraries.put(libUri, libUnit);
for (DartUnit unit : libUnit.getUnits()) {
+ // Don't analyze diet units.
+ if (unit.isDiet()) {
+ continue;
+ }
for (DartCompilationPhase phase : phases) {
unit = phase.exec(unit, context, compiler.getTypeProvider());
// Ignore errors. Resolver and TypeAnalyzer should be able to cope with
« 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