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

Side by Side Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 1222433003: Invalidate both hints and lints on incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library engine.incremental_resolver_test; 5 library engine.incremental_resolver_test;
6 6
7 import 'package:analyzer/src/context/cache.dart' as task; 7 import 'package:analyzer/src/context/cache.dart' as task;
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 analysisContext2 = AnalysisContextFactory.contextWithCore(); 2479 analysisContext2 = AnalysisContextFactory.contextWithCore();
2480 } else { 2480 } else {
2481 analysisContext2 = AnalysisContextFactory.oldContextWithCore(); 2481 analysisContext2 = AnalysisContextFactory.oldContextWithCore();
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 @override 2485 @override
2486 void resetWithOptions(AnalysisOptions options) { 2486 void resetWithOptions(AnalysisOptions options) {
2487 if (AnalysisEngine.instance.useTaskModel) { 2487 if (AnalysisEngine.instance.useTaskModel) {
2488 analysisContext2 = 2488 analysisContext2 =
2489 AnalysisContextFactory.contextWithCoreAndOptions(options); 2489 AnalysisContextFactory.contextWithCoreAndOptions(options);
2490 } else { 2490 } else {
2491 analysisContext2 = 2491 analysisContext2 =
2492 AnalysisContextFactory.oldContextWithCoreAndOptions(options); 2492 AnalysisContextFactory.oldContextWithCoreAndOptions(options);
2493 } 2493 }
2494 } 2494 }
2495 2495
2496 void setUp() { 2496 void setUp() {
2497 super.setUp(); 2497 super.setUp();
2498 test_resolveApiChanges = true; 2498 test_resolveApiChanges = true;
2499 log.logger = log.NULL_LOGGER; 2499 log.logger = log.NULL_LOGGER;
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
3704 _foo() { 3704 _foo() {
3705 print(12); 3705 print(12);
3706 } 3706 }
3707 } 3707 }
3708 '''); 3708 ''');
3709 // no hints 3709 // no hints
3710 List<AnalysisError> errors = analysisContext.getErrors(source).errors; 3710 List<AnalysisError> errors = analysisContext.getErrors(source).errors;
3711 expect(errors, isEmpty); 3711 expect(errors, isEmpty);
3712 } 3712 }
3713 3713
3714 void test_updateErrors_addNew_hint() { 3714 void test_updateErrors_addNew_hint1() {
3715 _resolveUnit(r''' 3715 _resolveUnit(r'''
3716 int main() { 3716 int main() {
3717 return 42; 3717 return 42;
3718 } 3718 }
3719 '''); 3719 ''');
3720 _updateAndValidate(r''' 3720 _updateAndValidate(r'''
3721 int main() { 3721 int main() {
3722 } 3722 }
3723 '''); 3723 ''');
3724 } 3724 }
3725 3725
3726 void test_updateErrors_addNew_hints() { 3726 void test_updateErrors_addNew_hint2() {
3727 _resolveUnit(r''' 3727 _resolveUnit(r'''
3728 main() { 3728 main() {
3729 int v = 0; 3729 int v = 0;
3730 print(v); 3730 print(v);
3731 } 3731 }
3732 '''); 3732 ''');
3733 _updateAndValidate(r''' 3733 _updateAndValidate(r'''
3734 main() { 3734 main() {
3735 int v = 0; 3735 int v = 0;
3736 } 3736 }
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4176 return ResolutionContextBuilder.contextFor(node, listener).scope; 4176 return ResolutionContextBuilder.contextFor(node, listener).scope;
4177 } 4177 }
4178 } 4178 }
4179 4179
4180 class _Edit { 4180 class _Edit {
4181 final int offset; 4181 final int offset;
4182 final int length; 4182 final int length;
4183 final String replacement; 4183 final String replacement;
4184 _Edit(this.offset, this.length, this.replacement); 4184 _Edit(this.offset, this.length, this.replacement);
4185 } 4185 }
OLDNEW
« 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