OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:analysis_server/protocol/protocol.dart'; | 5 import 'package:analysis_server/protocol/protocol.dart'; |
6 import 'package:analysis_server/protocol/protocol_generated.dart'; | 6 import 'package:analysis_server/protocol/protocol_generated.dart'; |
7 import 'package:analysis_server/src/edit/edit_domain.dart'; | 7 import 'package:analysis_server/src/edit/edit_domain.dart'; |
8 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 8 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
9 import 'package:plugin/manager.dart'; | 9 import 'package:plugin/manager.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 test_for() async { | 34 test_for() async { |
35 addTestFile(''' | 35 addTestFile(''' |
36 main() { | 36 main() { |
37 [].for | 37 [].for |
38 } | 38 } |
39 '''); | 39 '''); |
40 await waitForTasksFinished(); | 40 await waitForTasksFinished(); |
41 await _prepareCompletion('.for', atStart: true); | 41 await _prepareCompletion('.for', atStart: true); |
42 _assertHasChange( | 42 _assertHasChange('Expand .for', ''' |
43 'Expand .for', | |
44 ''' | |
45 main() { | 43 main() { |
46 for (var value in []) { | 44 for (var value in []) { |
47 /*caret*/ | 45 /*caret*/ |
48 } | 46 } |
49 } | 47 } |
50 '''); | 48 '''); |
51 } | 49 } |
52 | 50 |
53 void _assertHasChange(String message, String expectedCode, [Function cmp]) { | 51 void _assertHasChange(String message, String expectedCode, [Function cmp]) { |
54 if (change.message == message) { | 52 if (change.message == message) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (!isApplicable.value) { | 87 if (!isApplicable.value) { |
90 fail("Postfix completion not applicable at given location"); | 88 fail("Postfix completion not applicable at given location"); |
91 } | 89 } |
92 request = new EditGetPostfixCompletionParams(testFile, key, offset) | 90 request = new EditGetPostfixCompletionParams(testFile, key, offset) |
93 .toRequest('1'); | 91 .toRequest('1'); |
94 response = await waitResponse(request); | 92 response = await waitResponse(request); |
95 var result = new EditGetPostfixCompletionResult.fromResponse(response); | 93 var result = new EditGetPostfixCompletionResult.fromResponse(response); |
96 change = result.change; | 94 change = result.change; |
97 } | 95 } |
98 } | 96 } |
OLD | NEW |