| 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 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2621 set s1(I x) {} set _s2(I x) {} | 2621 set s1(I x) {} set _s2(I x) {} |
| 2622 m(X x) {} I _n(X x) {}} | 2622 m(X x) {} I _n(X x) {}} |
| 2623 class X{}'''); | 2623 class X{}'''); |
| 2624 addTestSource(''' | 2624 addTestSource(''' |
| 2625 import "/testB.dart"; | 2625 import "/testB.dart"; |
| 2626 main() {A a; a.^}'''); | 2626 main() {A a; a.^}'''); |
| 2627 computeFast(); | 2627 computeFast(); |
| 2628 return computeFull((bool result) { | 2628 return computeFull((bool result) { |
| 2629 expect(request.replacementOffset, completionOffset); | 2629 expect(request.replacementOffset, completionOffset); |
| 2630 expect(request.replacementLength, 0); | 2630 expect(request.replacementLength, 0); |
| 2631 assertSuggestInvocationField('sc', 'int'); | 2631 assertNotSuggested('sc'); |
| 2632 assertSuggestInvocationField('b', null, isDeprecated: true); | 2632 assertSuggestInvocationField('b', null, isDeprecated: true); |
| 2633 assertNotSuggested('_c'); | 2633 assertNotSuggested('_c'); |
| 2634 assertSuggestInvocationGetter('d', 'X'); | 2634 assertSuggestInvocationGetter('d', 'X'); |
| 2635 assertNotSuggested('_e'); | 2635 assertNotSuggested('_e'); |
| 2636 assertSuggestInvocationGetter('f', 'X'); | 2636 assertSuggestInvocationGetter('f', 'X'); |
| 2637 assertNotSuggested('_g'); | 2637 assertNotSuggested('_g'); |
| 2638 assertSuggestInvocationSetter('s1'); | 2638 assertSuggestInvocationSetter('s1'); |
| 2639 assertNotSuggested('_s2'); | 2639 assertNotSuggested('_s2'); |
| 2640 assertSuggestInvocationMethod('m', 'A', null); | 2640 assertSuggestInvocationMethod('m', 'A', null); |
| 2641 assertNotSuggested('_n'); | 2641 assertNotSuggested('_n'); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2656 static const int sc = 12; | 2656 static const int sc = 12; |
| 2657 var b; X _c; | 2657 var b; X _c; |
| 2658 X get d => new A();get _e => new A(); | 2658 X get d => new A();get _e => new A(); |
| 2659 set s1(I x) {} set _s2(I x) {} | 2659 set s1(I x) {} set _s2(I x) {} |
| 2660 m(X x) {} I _n(X x) {}} | 2660 m(X x) {} I _n(X x) {}} |
| 2661 class X{}'''); | 2661 class X{}'''); |
| 2662 computeFast(); | 2662 computeFast(); |
| 2663 return computeFull((bool result) { | 2663 return computeFull((bool result) { |
| 2664 expect(request.replacementOffset, completionOffset); | 2664 expect(request.replacementOffset, completionOffset); |
| 2665 expect(request.replacementLength, 0); | 2665 expect(request.replacementLength, 0); |
| 2666 assertSuggestInvocationField('sc', 'int'); | 2666 assertNotSuggested('sc'); |
| 2667 assertSuggestInvocationField('b', null); | 2667 assertSuggestInvocationField('b', null); |
| 2668 assertSuggestInvocationField('_c', 'X'); | 2668 assertSuggestInvocationField('_c', 'X'); |
| 2669 assertSuggestInvocationGetter('d', 'X'); | 2669 assertSuggestInvocationGetter('d', 'X'); |
| 2670 assertSuggestInvocationGetter('_e', null); | 2670 assertSuggestInvocationGetter('_e', null); |
| 2671 assertSuggestInvocationGetter('f', 'X'); | 2671 assertSuggestInvocationGetter('f', 'X'); |
| 2672 assertSuggestInvocationGetter('_g', null); | 2672 assertSuggestInvocationGetter('_g', null); |
| 2673 assertSuggestInvocationSetter('s1'); | 2673 assertSuggestInvocationSetter('s1'); |
| 2674 assertSuggestInvocationSetter('_s2'); | 2674 assertSuggestInvocationSetter('_s2'); |
| 2675 assertSuggestInvocationMethod('m', 'A', null); | 2675 assertSuggestInvocationMethod('m', 'A', null); |
| 2676 assertSuggestInvocationMethod('_n', 'A', 'I'); | 2676 assertSuggestInvocationMethod('_n', 'A', 'I'); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 assertNotSuggested('bar2'); | 2967 assertNotSuggested('bar2'); |
| 2968 assertNotSuggested('_B'); | 2968 assertNotSuggested('_B'); |
| 2969 assertSuggestLocalClass('Y'); | 2969 assertSuggestLocalClass('Y'); |
| 2970 assertSuggestLocalClass('C'); | 2970 assertSuggestLocalClass('C'); |
| 2971 assertSuggestLocalVariable('f', null); | 2971 assertSuggestLocalVariable('f', null); |
| 2972 assertNotSuggested('x'); | 2972 assertNotSuggested('x'); |
| 2973 assertNotSuggested('e'); | 2973 assertNotSuggested('e'); |
| 2974 }); | 2974 }); |
| 2975 } | 2975 } |
| 2976 } | 2976 } |
| OLD | NEW |