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/plugin/protocol/protocol.dart' as protocol | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol |
10 show Element, ElementKind; | 10 show Element, ElementKind; |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 class E extends F { var e1; e2() { } } | 1742 class E extends F { var e1; e2() { } } |
1743 class I { int i1; i2() { } } | 1743 class I { int i1; i2() { } } |
1744 class M { var m1; int m2() { } }'''); | 1744 class M { var m1; int m2() { } }'''); |
1745 addTestSource(''' | 1745 addTestSource(''' |
1746 import "/testB.dart"; | 1746 import "/testB.dart"; |
1747 class A extends E implements I with M {a() {^}}'''); | 1747 class A extends E implements I with M {a() {^}}'''); |
1748 computeFast(); | 1748 computeFast(); |
1749 return computeFull((bool result) { | 1749 return computeFull((bool result) { |
1750 expect(request.replacementOffset, completionOffset); | 1750 expect(request.replacementOffset, completionOffset); |
1751 expect(request.replacementLength, 0); | 1751 expect(request.replacementLength, 0); |
1752 // TODO (danrubel) prefer fields over getters | 1752 assertNotSuggested('e1'); |
1753 // If add `get e1;` to interface I | 1753 assertNotSuggested('f1'); |
1754 // then suggestions include getter e1 rather than field e1 | 1754 assertNotSuggested('i1'); |
1755 assertSuggestImportedField('e1', null); | 1755 assertNotSuggested('m1'); |
1756 assertSuggestImportedField('f1', null); | 1756 assertNotSuggested('f3'); |
1757 assertSuggestImportedField('i1', 'int'); | 1757 assertNotSuggested('f4'); |
1758 assertSuggestImportedField('m1', null); | 1758 assertNotSuggested('e2'); |
1759 assertSuggestImportedGetter('f3', null); | 1759 assertNotSuggested('f2'); |
1760 assertSuggestImportedSetter('f4'); | 1760 assertNotSuggested('i2'); |
1761 assertSuggestImportedMethod('e2', 'E', null); | 1761 assertNotSuggested('m2'); |
1762 assertSuggestImportedMethod('f2', 'F', null); | |
1763 assertSuggestImportedMethod('i2', 'I', null); | |
1764 //assertSuggestImportedMethod('m2', null, null); | |
1765 assertNotSuggested('=='); | 1762 assertNotSuggested('=='); |
1766 }); | 1763 }); |
1767 } | 1764 } |
1768 | 1765 |
1769 test_Block_inherited_local() { | 1766 test_Block_inherited_local() { |
1770 // Block BlockFunctionBody MethodDeclaration ClassDeclaration | 1767 // Block BlockFunctionBody MethodDeclaration ClassDeclaration |
1771 addTestSource(''' | 1768 addTestSource(''' |
1772 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } | 1769 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } |
1773 class E extends F { var e1; e2() { } } | 1770 class E extends F { var e1; e2() { } } |
1774 class I { int i1; i2() { } } | 1771 class I { int i1; i2() { } } |
(...skipping 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4669 assertNotSuggested('bar2'); | 4666 assertNotSuggested('bar2'); |
4670 assertNotSuggested('_B'); | 4667 assertNotSuggested('_B'); |
4671 assertSuggestLocalClass('Y'); | 4668 assertSuggestLocalClass('Y'); |
4672 assertSuggestLocalClass('C'); | 4669 assertSuggestLocalClass('C'); |
4673 assertSuggestLocalVariable('f', null); | 4670 assertSuggestLocalVariable('f', null); |
4674 assertNotSuggested('x'); | 4671 assertNotSuggested('x'); |
4675 assertNotSuggested('e'); | 4672 assertNotSuggested('e'); |
4676 }); | 4673 }); |
4677 } | 4674 } |
4678 } | 4675 } |
OLD | NEW |