| 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.dart.local; | 5 library test.services.completion.dart.local; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol_server.dart'; | 7 import 'package:analysis_server/src/protocol_server.dart'; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:analysis_server/src/services/completion/local_computer.dart'; | 9 import 'package:analysis_server/src/services/completion/local_computer.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 void main() { | 187 void main() { |
| 188 while (true) { | 188 while (true) { |
| 189 break ^ | 189 break ^ |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 '''); | 192 '''); |
| 193 expect(computeFast(), isTrue); | 193 expect(computeFast(), isTrue); |
| 194 assertNotSuggested('x'); | 194 assertNotSuggested('x'); |
| 195 } | 195 } |
| 196 | 196 |
| 197 test_overrides() { |
| 198 addTestSource(''' |
| 199 class A {m() {}} |
| 200 class B extends A {m() {^}} |
| 201 '''); |
| 202 expect(computeFast(), isTrue); |
| 203 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); |
| 204 } |
| 205 |
| 197 test_break_ignores_unrelated_statements() { | 206 test_break_ignores_unrelated_statements() { |
| 198 addTestSource(''' | 207 addTestSource(''' |
| 199 void main() { | 208 void main() { |
| 200 foo: while (true) {} | 209 foo: while (true) {} |
| 201 while (true) { break ^ } | 210 while (true) { break ^ } |
| 202 bar: while (true) {} | 211 bar: while (true) {} |
| 203 } | 212 } |
| 204 '''); | 213 '''); |
| 205 expect(computeFast(), isTrue); | 214 expect(computeFast(), isTrue); |
| 206 // The scope of the label defined by a labeled statement is just the | 215 // The scope of the label defined by a labeled statement is just the |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 expect(suggestion.requiredParameterCount, 2); | 742 expect(suggestion.requiredParameterCount, 2); |
| 734 expect(suggestion.hasNamedParameters, false); | 743 expect(suggestion.hasNamedParameters, false); |
| 735 } | 744 } |
| 736 | 745 |
| 737 test_shadowed_name() { | 746 test_shadowed_name() { |
| 738 addTestSource('var a; class A { var a; m() { ^ } }'); | 747 addTestSource('var a; class A { var a; m() { ^ } }'); |
| 739 expect(computeFast(), isTrue); | 748 expect(computeFast(), isTrue); |
| 740 assertSuggestLocalField('a', null); | 749 assertSuggestLocalField('a', null); |
| 741 } | 750 } |
| 742 } | 751 } |
| OLD | NEW |