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

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

Issue 757743004: Update errors during incremental resolution. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: 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,
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error.dart » ('j') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698