| 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 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 return computeFull((bool result) { | 2208 return computeFull((bool result) { |
| 2209 expect(request.replacementOffset, completionOffset); | 2209 expect(request.replacementOffset, completionOffset); |
| 2210 expect(request.replacementLength, 0); | 2210 expect(request.replacementLength, 0); |
| 2211 assertSuggestInvocationGetter('length', 'int'); | 2211 assertSuggestInvocationGetter('length', 'int'); |
| 2212 assertNotSuggested('name'); | 2212 assertNotSuggested('name'); |
| 2213 assertNotSuggested('Object'); | 2213 assertNotSuggested('Object'); |
| 2214 assertNotSuggested('=='); | 2214 assertNotSuggested('=='); |
| 2215 }); | 2215 }); |
| 2216 } | 2216 } |
| 2217 | 2217 |
| 2218 test_InterpolationExpression_prefix_selector2() { |
| 2219 // SimpleIdentifier PrefixedIdentifier InterpolationExpression |
| 2220 addTestSource('main() {String name; print("hello \$name.^");}'); |
| 2221 computeFast(); |
| 2222 return computeFull((bool result) { |
| 2223 assertNoSuggestions(); |
| 2224 }); |
| 2225 } |
| 2226 |
| 2218 test_InterpolationExpression_prefix_target() { | 2227 test_InterpolationExpression_prefix_target() { |
| 2219 // SimpleIdentifier PrefixedIdentifier InterpolationExpression | 2228 // SimpleIdentifier PrefixedIdentifier InterpolationExpression |
| 2220 addTestSource('main() {String name; print("hello \${nam^e.length}");}'); | 2229 addTestSource('main() {String name; print("hello \${nam^e.length}");}'); |
| 2221 computeFast(); | 2230 computeFast(); |
| 2222 return computeFull((bool result) { | 2231 return computeFull((bool result) { |
| 2223 assertSuggestLocalVariable('name', 'String'); | 2232 assertSuggestLocalVariable('name', 'String'); |
| 2224 // top level results are partially filtered | 2233 // top level results are partially filtered |
| 2225 //assertSuggestImportedClass('Object'); | 2234 //assertSuggestImportedClass('Object'); |
| 2226 assertNotSuggested('length'); | 2235 assertNotSuggested('length'); |
| 2227 }); | 2236 }); |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2991 assertNotSuggested('bar2'); | 3000 assertNotSuggested('bar2'); |
| 2992 assertNotSuggested('_B'); | 3001 assertNotSuggested('_B'); |
| 2993 assertSuggestLocalClass('Y'); | 3002 assertSuggestLocalClass('Y'); |
| 2994 assertSuggestLocalClass('C'); | 3003 assertSuggestLocalClass('C'); |
| 2995 assertSuggestLocalVariable('f', null); | 3004 assertSuggestLocalVariable('f', null); |
| 2996 assertNotSuggested('x'); | 3005 assertNotSuggested('x'); |
| 2997 assertNotSuggested('e'); | 3006 assertNotSuggested('e'); |
| 2998 }); | 3007 }); |
| 2999 } | 3008 } |
| 3000 } | 3009 } |
| OLD | NEW |