| 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.toplevel; | 5 library test.services.completion.toplevel; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/completion/imported_computer.dart'; | 8 import 'package:analysis_server/src/services/completion/imported_computer.dart'; |
| 9 import '../../reflective_tests.dart'; | 9 import '../../reflective_tests.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 test_local_name2() { | 157 test_local_name2() { |
| 158 addSource('/testA.dart', 'var T1;'); | 158 addSource('/testA.dart', 'var T1;'); |
| 159 addTestSource('import "/testA.dart"; class C {a() {var ^}}'); | 159 addTestSource('import "/testA.dart"; class C {a() {var ^}}'); |
| 160 return computeFull().then((_) { | 160 return computeFull().then((_) { |
| 161 assertNotSuggested('T1'); | 161 assertNotSuggested('T1'); |
| 162 }); | 162 }); |
| 163 } | 163 } |
| 164 | 164 |
| 165 test_import_dart() { |
| 166 addTestSource('import "dart^"; main() {}'); |
| 167 return computeFull().then((_) { |
| 168 assertNotSuggested('T1'); |
| 169 }); |
| 170 } |
| 171 |
| 165 test_topLevelVar() { | 172 test_topLevelVar() { |
| 166 addSource('/testA.dart', 'String T1; var _T2;'); | 173 addSource('/testA.dart', 'String T1; var _T2;'); |
| 167 addTestSource('import "/testA.dart"; class C {foo(){^}}'); | 174 addTestSource('import "/testA.dart"; class C {foo(){^}}'); |
| 168 return computeFull().then((_) { | 175 return computeFull().then((_) { |
| 169 assertSuggestTopLevelVar('T1', 'String'); | 176 assertSuggestTopLevelVar('T1', 'String'); |
| 170 assertNotSuggested('_T2'); | 177 assertNotSuggested('_T2'); |
| 171 }); | 178 }); |
| 172 } | 179 } |
| 173 | 180 |
| 174 test_topLevelVar_name() { | 181 test_topLevelVar_name() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 189 | 196 |
| 190 test_topLevelVar_notImported() { | 197 test_topLevelVar_notImported() { |
| 191 addSource('/testA.dart', 'var T1; var _T2;'); | 198 addSource('/testA.dart', 'var T1; var _T2;'); |
| 192 addTestSource('class C {foo(){^}}'); | 199 addTestSource('class C {foo(){^}}'); |
| 193 return computeFull(true).then((_) { | 200 return computeFull(true).then((_) { |
| 194 assertSuggestTopLevelVar('T1', null, CompletionRelevance.LOW); | 201 assertSuggestTopLevelVar('T1', null, CompletionRelevance.LOW); |
| 195 assertNotSuggested('_T2'); | 202 assertNotSuggested('_T2'); |
| 196 }); | 203 }); |
| 197 } | 204 } |
| 198 } | 205 } |
| OLD | NEW |