| 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 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 assertSuggestInvocationClass('Y'); | 3258 assertSuggestInvocationClass('Y'); |
| 3259 assertNotSuggested('T1'); | 3259 assertNotSuggested('T1'); |
| 3260 assertNotSuggested('T2'); | 3260 assertNotSuggested('T2'); |
| 3261 assertNotSuggested('Object'); | 3261 assertNotSuggested('Object'); |
| 3262 assertNotSuggested('b'); | 3262 assertNotSuggested('b'); |
| 3263 assertNotSuggested('A'); | 3263 assertNotSuggested('A'); |
| 3264 assertNotSuggested('=='); | 3264 assertNotSuggested('=='); |
| 3265 }); | 3265 }); |
| 3266 } | 3266 } |
| 3267 | 3267 |
| 3268 test_PrefixedIdentifier_library_typesOnly2() { |
| 3269 // SimpleIdentifier PrefixedIdentifier TypeName |
| 3270 addSource('/testB.dart', ''' |
| 3271 lib B; |
| 3272 var T1; |
| 3273 class X { } |
| 3274 class Y { }'''); |
| 3275 addTestSource(''' |
| 3276 import "/testB.dart" as b; |
| 3277 var T2; |
| 3278 class A { } |
| 3279 foo(b.^) {}'''); |
| 3280 computeFast(); |
| 3281 return computeFull((bool result) { |
| 3282 expect(request.replacementOffset, completionOffset); |
| 3283 expect(request.replacementLength, 0); |
| 3284 assertSuggestInvocationClass('X'); |
| 3285 assertSuggestInvocationClass('Y'); |
| 3286 assertNotSuggested('T1'); |
| 3287 assertNotSuggested('T2'); |
| 3288 assertNotSuggested('Object'); |
| 3289 assertNotSuggested('b'); |
| 3290 assertNotSuggested('A'); |
| 3291 assertNotSuggested('=='); |
| 3292 }); |
| 3293 } |
| 3294 |
| 3268 test_PrefixedIdentifier_parameter() { | 3295 test_PrefixedIdentifier_parameter() { |
| 3269 // SimpleIdentifier PrefixedIdentifier ExpressionStatement | 3296 // SimpleIdentifier PrefixedIdentifier ExpressionStatement |
| 3270 addSource('/testB.dart', ''' | 3297 addSource('/testB.dart', ''' |
| 3271 lib B; | 3298 lib B; |
| 3272 class _W {M y; var _z;} | 3299 class _W {M y; var _z;} |
| 3273 class X extends _W {} | 3300 class X extends _W {} |
| 3274 class M{}'''); | 3301 class M{}'''); |
| 3275 addTestSource(''' | 3302 addTestSource(''' |
| 3276 import "/testB.dart"; | 3303 import "/testB.dart"; |
| 3277 foo(X x) {x.^}'''); | 3304 foo(X x) {x.^}'''); |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3682 assertNotSuggested('bar2'); | 3709 assertNotSuggested('bar2'); |
| 3683 assertNotSuggested('_B'); | 3710 assertNotSuggested('_B'); |
| 3684 assertSuggestLocalClass('Y'); | 3711 assertSuggestLocalClass('Y'); |
| 3685 assertSuggestLocalClass('C'); | 3712 assertSuggestLocalClass('C'); |
| 3686 assertSuggestLocalVariable('f', null); | 3713 assertSuggestLocalVariable('f', null); |
| 3687 assertNotSuggested('x'); | 3714 assertNotSuggested('x'); |
| 3688 assertNotSuggested('e'); | 3715 assertNotSuggested('e'); |
| 3689 }); | 3716 }); |
| 3690 } | 3717 } |
| 3691 } | 3718 } |
| OLD | NEW |