| 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 89ac390ba9cce6bd73bb6cd16741a9e5994e53f1..d32c825b611aae55a770980b4fc3db03d83135f0 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -21,7 +21,7 @@ import 'error_verifier.dart';
|
| import 'html.dart' as ht;
|
| import 'incremental_scanner.dart';
|
| import 'incremental_resolver.dart' show IncrementalResolver,
|
| - poorMansIncrementalResolution;
|
| + PoorMansIncrementalResolver;
|
| import 'instrumentation.dart';
|
| import 'java_core.dart';
|
| import 'java_engine.dart';
|
| @@ -4924,22 +4924,34 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| * TODO(scheglov) A hackish, limited incremental resolution implementation.
|
| */
|
| bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) {
|
| + DartEntry dartEntry = _cache.get(unitSource);
|
| + if (dartEntry == null) {
|
| + return false;
|
| + }
|
| + // prepare the (only) library
|
| List<Source> librarySources = getLibrariesContaining(unitSource);
|
| if (librarySources.length != 1) {
|
| return false;
|
| }
|
| + // do resolution
|
| + Source librarySource = librarySources[0];
|
| CompilationUnit oldUnit =
|
| - getResolvedCompilationUnit2(unitSource, librarySources[0]);
|
| - bool success = poorMansIncrementalResolution(typeProvider, oldUnit, newCode);
|
| + getResolvedCompilationUnit2(unitSource, librarySource);
|
| + PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
|
| + typeProvider,
|
| + unitSource,
|
| + librarySource,
|
| + dartEntry);
|
| + bool success = resolver.resolve(oldUnit, newCode);
|
| if (!success) {
|
| return false;
|
| }
|
| + // prepare notice
|
| ChangeNoticeImpl notice = _getNotice(unitSource);
|
| notice.compilationUnit = oldUnit;
|
| // TODO(scheglov) apply updated errors
|
| {
|
| LineInfo lineInfo = getLineInfo(unitSource);
|
| - DartEntry dartEntry = _cache.get(unitSource);
|
| notice.setErrors(dartEntry.allErrors, lineInfo);
|
| }
|
| return true;
|
| @@ -10464,7 +10476,6 @@ class IncrementalAnalysisTask extends AnalysisTask {
|
| LibraryElement library = element.library;
|
| if (library != null) {
|
| IncrementalResolver resolver = new IncrementalResolver(
|
| - errorListener,
|
| typeProvider,
|
| library,
|
| element,
|
|
|