| OLD | NEW |
| 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 test.services.completion.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 assertSuggestImportedTopLevelVar('T3', 'int', CompletionRelevance.LOW); | 672 assertSuggestImportedTopLevelVar('T3', 'int', CompletionRelevance.LOW); |
| 673 assertNotSuggested('_T4'); | 673 assertNotSuggested('_T4'); |
| 674 assertSuggestLocalTopLevelVar('T5', 'int'); | 674 assertSuggestLocalTopLevelVar('T5', 'int'); |
| 675 assertSuggestLocalTopLevelVar('_T6', null); | 675 assertSuggestLocalTopLevelVar('_T6', null); |
| 676 assertNotSuggested('=='); | 676 assertNotSuggested('=='); |
| 677 // TODO (danrubel) suggest HtmlElement as low relevance | 677 // TODO (danrubel) suggest HtmlElement as low relevance |
| 678 assertNotSuggested('HtmlElement'); | 678 assertNotSuggested('HtmlElement'); |
| 679 }); | 679 }); |
| 680 } | 680 } |
| 681 | 681 |
| 682 test_Block_inherited_imported() { |
| 683 // Block BlockFunctionBody MethodDeclaration ClassDeclaration |
| 684 addSource('/testB.dart', ''' |
| 685 lib B; |
| 686 class F { var f1; f2() { } } |
| 687 class E extends F { var e1; e2() { } } |
| 688 class I { int i1; i2() { } } |
| 689 class M { var m1; int m2() { } }'''); |
| 690 addTestSource(''' |
| 691 import "/testB.dart"; |
| 692 class A extends E implements I with M {a() {^}}'''); |
| 693 computeFast(); |
| 694 return computeFull(true).then((_) { |
| 695 assertSuggestImportedGetter('e1', null); |
| 696 assertSuggestImportedGetter('f1', null); |
| 697 assertSuggestImportedGetter('i1', 'int'); |
| 698 assertSuggestImportedGetter('m1', null); |
| 699 //TODO (danrubel) include declared type in suggestion |
| 700 assertSuggestImportedMethod('e2', null, null); |
| 701 assertSuggestImportedMethod('f2', null, null); |
| 702 assertSuggestImportedMethod('i2', null, null); |
| 703 //assertSuggestImportedMethod('m2', null, null); |
| 704 assertNotSuggested('=='); |
| 705 }); |
| 706 } |
| 707 |
| 682 test_Block_inherited_local() { | 708 test_Block_inherited_local() { |
| 683 // Block BlockFunctionBody MethodDeclaration ClassDeclaration | 709 // Block BlockFunctionBody MethodDeclaration ClassDeclaration |
| 684 addTestSource(''' | 710 addTestSource(''' |
| 685 class F { var f1; f2() { } } | 711 class F { var f1; f2() { } } |
| 686 class E extends F { var e1; e2() { } } | 712 class E extends F { var e1; e2() { } } |
| 687 class I { int i1; i2() { } } | 713 class I { int i1; i2() { } } |
| 688 class M { var m1; int m2() { } } | 714 class M { var m1; int m2() { } } |
| 689 class A extends E implements I with M {a() {^}}'''); | 715 class A extends E implements I with M {a() {^}}'''); |
| 690 computeFast(); | 716 computeFast(); |
| 691 return computeFull(true).then((_) { | 717 return computeFull(true).then((_) { |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 assertSuggestImportedClass('X'); | 1556 assertSuggestImportedClass('X'); |
| 1531 assertNotSuggested('_B'); | 1557 assertNotSuggested('_B'); |
| 1532 assertSuggestLocalClass('Y'); | 1558 assertSuggestLocalClass('Y'); |
| 1533 assertSuggestLocalClass('C'); | 1559 assertSuggestLocalClass('C'); |
| 1534 assertSuggestLocalVariable('f', null); | 1560 assertSuggestLocalVariable('f', null); |
| 1535 assertNotSuggested('x'); | 1561 assertNotSuggested('x'); |
| 1536 assertNotSuggested('e'); | 1562 assertNotSuggested('e'); |
| 1537 }); | 1563 }); |
| 1538 } | 1564 } |
| 1539 } | 1565 } |
| OLD | NEW |