| 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 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2018 addSource('/testA.dart', 'class A { }'); | 2018 addSource('/testA.dart', 'class A { }'); |
| 2019 addTestSource(''' | 2019 addTestSource(''' |
| 2020 import "/testA.dart"; | 2020 import "/testA.dart"; |
| 2021 class C {var ^}'''); | 2021 class C {var ^}'''); |
| 2022 computeFast(); | 2022 computeFast(); |
| 2023 return computeFull((bool result) { | 2023 return computeFull((bool result) { |
| 2024 assertNoSuggestions(); | 2024 assertNoSuggestions(); |
| 2025 }); | 2025 }); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 test_FieldFormalParameter_in_non_constructor() { |
| 2029 // SimpleIdentifer FieldFormalParameter FormalParameterList |
| 2030 addTestSource('class A {B(this.^foo) {}}'); |
| 2031 return computeFull((bool result) { |
| 2032 expect(request.replacementOffset, completionOffset); |
| 2033 expect(request.replacementLength, 3); |
| 2034 assertNoSuggestions(); |
| 2035 }); |
| 2036 } |
| 2037 |
| 2028 test_ForEachStatement_body_typed() { | 2038 test_ForEachStatement_body_typed() { |
| 2029 // Block ForEachStatement | 2039 // Block ForEachStatement |
| 2030 addTestSource('main(args) {for (int foo in bar) {^}}'); | 2040 addTestSource('main(args) {for (int foo in bar) {^}}'); |
| 2031 computeFast(); | 2041 computeFast(); |
| 2032 return computeFull((bool result) { | 2042 return computeFull((bool result) { |
| 2033 expect(request.replacementOffset, completionOffset); | 2043 expect(request.replacementOffset, completionOffset); |
| 2034 expect(request.replacementLength, 0); | 2044 expect(request.replacementLength, 0); |
| 2035 assertSuggestParameter('args', null); | 2045 assertSuggestParameter('args', null); |
| 2036 assertSuggestLocalVariable('foo', 'int'); | 2046 assertSuggestLocalVariable('foo', 'int'); |
| 2037 assertSuggestImportedClass('Object'); | 2047 assertSuggestImportedClass('Object'); |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3935 assertNotSuggested('bar2'); | 3945 assertNotSuggested('bar2'); |
| 3936 assertNotSuggested('_B'); | 3946 assertNotSuggested('_B'); |
| 3937 assertSuggestLocalClass('Y'); | 3947 assertSuggestLocalClass('Y'); |
| 3938 assertSuggestLocalClass('C'); | 3948 assertSuggestLocalClass('C'); |
| 3939 assertSuggestLocalVariable('f', null); | 3949 assertSuggestLocalVariable('f', null); |
| 3940 assertNotSuggested('x'); | 3950 assertNotSuggested('x'); |
| 3941 assertNotSuggested('e'); | 3951 assertNotSuggested('e'); |
| 3942 }); | 3952 }); |
| 3943 } | 3953 } |
| 3944 } | 3954 } |
| OLD | NEW |