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: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 901713004: Invalidate hints instead of computing them in the incremental resolver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Invalidate hints for included parts too Created 5 years, 10 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 | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/incremental_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index 90106a9f23e9d50753acaadf9726bb9ffc9c6579..5e41ef607417a0352e99f2fdd8e08f950bbef8b4 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -2506,13 +2506,14 @@ class B {
int updateOffset = edit.offset;
int updateEndOld = updateOffset + edit.length;
int updateOldNew = updateOffset + edit.replacement.length;
- IncrementalResolver resolver =
- new IncrementalResolver(<Source, CompilationUnit>{
- source: newUnit
- }, unit.element, updateOffset, updateEndOld, updateOldNew);
+ IncrementalResolver resolver = new IncrementalResolver(
+ unit.element,
+ updateOffset,
+ updateEndOld,
+ updateOldNew);
bool success = resolver.resolve(newNode);
expect(success, isTrue);
- List<AnalysisError> newErrors = analysisContext.getErrors(source).errors;
+ List<AnalysisError> newErrors = analysisContext.computeErrors(source);
// resolve "newCode" from scratch
CompilationUnit fullNewUnit;
{
@@ -3211,8 +3212,13 @@ f(A a) {
// a._foo();
}
''');
+ // no hints right now, because we delay hints computing
+ {
+ List<AnalysisError> errors = analysisContext.getErrors(source).errors;
+ expect(errors, isEmpty);
+ }
// a new hint should be added
- List<AnalysisError> errors = analysisContext.getErrors(source).errors;
+ List<AnalysisError> errors = analysisContext.computeErrors(source);
expect(errors, hasLength(1));
expect(errors[0].errorCode.type, ErrorType.HINT);
// the same hint should be reported using a ChangeNotice
@@ -3458,7 +3464,7 @@ f3() {
_resetWithIncremental(true);
analysisContext2.setContents(source, newCode);
CompilationUnit newUnit = resolveCompilationUnit(source, oldLibrary);
- List<AnalysisError> newErrors = analysisContext.getErrors(source).errors;
+ List<AnalysisError> newErrors = analysisContext.computeErrors(source);
// check for expected failure
if (!expectedSuccess) {
expect(newUnit.element, isNot(same(oldUnitElement)));
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698