| 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 | 9 import 'package:analysis_server/src/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| (...skipping 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 assertSuggestInvocationClass('Y'); | 3231 assertSuggestInvocationClass('Y'); |
| 3232 assertSuggestInvocationTopLevelVar('T1', null); | 3232 assertSuggestInvocationTopLevelVar('T1', null); |
| 3233 assertNotSuggested('T2'); | 3233 assertNotSuggested('T2'); |
| 3234 assertNotSuggested('Object'); | 3234 assertNotSuggested('Object'); |
| 3235 assertNotSuggested('b'); | 3235 assertNotSuggested('b'); |
| 3236 assertNotSuggested('A'); | 3236 assertNotSuggested('A'); |
| 3237 assertNotSuggested('=='); | 3237 assertNotSuggested('=='); |
| 3238 }); | 3238 }); |
| 3239 } | 3239 } |
| 3240 | 3240 |
| 3241 test_PrefixedIdentifier_library_typesOnly() { |
| 3242 // SimpleIdentifier PrefixedIdentifier TypeName |
| 3243 addSource('/testB.dart', ''' |
| 3244 lib B; |
| 3245 var T1; |
| 3246 class X { } |
| 3247 class Y { }'''); |
| 3248 addTestSource(''' |
| 3249 import "/testB.dart" as b; |
| 3250 var T2; |
| 3251 class A { } |
| 3252 foo(b.^ f) {}'''); |
| 3253 computeFast(); |
| 3254 return computeFull((bool result) { |
| 3255 expect(request.replacementOffset, completionOffset); |
| 3256 expect(request.replacementLength, 0); |
| 3257 assertSuggestInvocationClass('X'); |
| 3258 assertSuggestInvocationClass('Y'); |
| 3259 assertNotSuggested('T1'); |
| 3260 assertNotSuggested('T2'); |
| 3261 assertNotSuggested('Object'); |
| 3262 assertNotSuggested('b'); |
| 3263 assertNotSuggested('A'); |
| 3264 assertNotSuggested('=='); |
| 3265 }); |
| 3266 } |
| 3267 |
| 3241 test_PrefixedIdentifier_parameter() { | 3268 test_PrefixedIdentifier_parameter() { |
| 3242 // SimpleIdentifier PrefixedIdentifier ExpressionStatement | 3269 // SimpleIdentifier PrefixedIdentifier ExpressionStatement |
| 3243 addSource('/testB.dart', ''' | 3270 addSource('/testB.dart', ''' |
| 3244 lib B; | 3271 lib B; |
| 3245 class _W {M y; var _z;} | 3272 class _W {M y; var _z;} |
| 3246 class X extends _W {} | 3273 class X extends _W {} |
| 3247 class M{}'''); | 3274 class M{}'''); |
| 3248 addTestSource(''' | 3275 addTestSource(''' |
| 3249 import "/testB.dart"; | 3276 import "/testB.dart"; |
| 3250 foo(X x) {x.^}'''); | 3277 foo(X x) {x.^}'''); |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 assertNotSuggested('bar2'); | 3682 assertNotSuggested('bar2'); |
| 3656 assertNotSuggested('_B'); | 3683 assertNotSuggested('_B'); |
| 3657 assertSuggestLocalClass('Y'); | 3684 assertSuggestLocalClass('Y'); |
| 3658 assertSuggestLocalClass('C'); | 3685 assertSuggestLocalClass('C'); |
| 3659 assertSuggestLocalVariable('f', null); | 3686 assertSuggestLocalVariable('f', null); |
| 3660 assertNotSuggested('x'); | 3687 assertNotSuggested('x'); |
| 3661 assertNotSuggested('e'); | 3688 assertNotSuggested('e'); |
| 3662 }); | 3689 }); |
| 3663 } | 3690 } |
| 3664 } | 3691 } |
| OLD | NEW |