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

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

Issue 9860034: 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 | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseLibraryFileTask.java » ('j') | 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 5855)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -5,6 +5,7 @@
package com.google.dart.compiler;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.collect.Sets.SetView;
import com.google.common.io.CharStreams;
@@ -1158,34 +1159,26 @@
resolvedLibs.getClass(); // Quick null check.
DartCompilerMainContext context = new DartCompilerMainContext(lib, provider, listener, config);
Compiler compiler = new SelectiveCompiler(lib, resolvedLibs, parsedUnits, config, context);
- LibraryUnit libraryUnit = compiler.updateAndResolve();
- if (libraryUnit != null) {
- // Ignore errors. Resolver should be able to cope with
- // errors. Otherwise, we should fix it.
- DartCompilationPhase[] phases = {
- new Resolver.Phase(),
- new TypeAnalyzer()
- };
- for (DartUnit unit : libraryUnit.getUnits()) {
- // Don't analyze diet units.
- if (unit.isDiet()) {
- continue;
- }
- for (DartCompilationPhase phase : phases) {
- unit = phase.exec(unit, context, compiler.getTypeProvider());
- // Ignore errors. TypeAnalyzer should be able to cope with
- // resolution errors.
+ compiler.updateAndResolve();
+
+ DartCompilationPhase[] phases = {new Resolver.Phase(), new TypeAnalyzer()};
+ Map<URI, LibraryUnit> newLibraries = Maps.newHashMap();
+ for (Entry<URI, LibraryUnit> entry : compiler.getLibraries().entrySet()) {
+ URI libUri = entry.getKey();
+ LibraryUnit libUnit = entry.getValue();
+ if (!resolvedLibs.containsKey(libUri) && libUnit != null) {
+ newLibraries.put(libUri, libUnit);
+ for (DartUnit unit : libUnit.getUnits()) {
+ for (DartCompilationPhase phase : phases) {
+ unit = phase.exec(unit, context, compiler.getTypeProvider());
+ // Ignore errors. Resolver and TypeAnalyzer should be able to cope with
+ // resolution errors.
+ }
}
}
}
- Map<URI,LibraryUnit> newLibraries = new HashMap<URI, LibraryUnit>();
- for (Entry<URI, LibraryUnit> entry : compiler.getLibraries().entrySet()) {
- if (!resolvedLibs.containsKey(entry.getKey())) {
- newLibraries.put(entry.getKey(), entry.getValue());
- }
- }
- newLibraries.put(lib.getUri(), libraryUnit);
+
return newLibraries;
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ParseLibraryFileTask.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698