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 library test.edit.statement_completion; | 5 library test.edit.statement_completion; |
6 | 6 |
7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
9 import 'package:analysis_server/src/edit/edit_domain.dart'; | 9 import 'package:analysis_server/src/edit/edit_domain.dart'; |
10 import 'package:plugin/manager.dart'; | 10 import 'package:plugin/manager.dart'; |
11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 | 13 |
14 import '../analysis_abstract.dart'; | 14 import '../analysis_abstract.dart'; |
15 | 15 |
16 main() { | 16 main() { |
17 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
18 defineReflectiveTests(StatementCompletionTest); | 18 defineReflectiveTests(StatementCompletionTest); |
19 }); | 19 }); |
20 } | 20 } |
21 | 21 |
22 @reflectiveTest | 22 @reflectiveTest |
23 class StatementCompletionTest extends AbstractAnalysisTest { | 23 class StatementCompletionTest extends AbstractAnalysisTest { |
24 SourceChange change; | 24 SourceChange change; |
25 | 25 |
26 @override | 26 @override |
27 void setUp() { | 27 void setUp() { |
28 enableNewAnalysisDriver = true; | |
29 super.setUp(); | 28 super.setUp(); |
30 createProject(); | 29 createProject(); |
31 ExtensionManager manager = new ExtensionManager(); | 30 ExtensionManager manager = new ExtensionManager(); |
32 manager.processPlugins([server.serverPlugin]); | 31 manager.processPlugins([server.serverPlugin]); |
33 handler = new EditDomainHandler(server); | 32 handler = new EditDomainHandler(server); |
34 } | 33 } |
35 | 34 |
36 test_plainEnterFromStart() async { | 35 test_plainEnterFromStart() async { |
37 addTestFile(''' | 36 addTestFile(''' |
38 main() { | 37 main() { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 121 } |
123 | 122 |
124 _prepareCompletionAt(int offset) async { | 123 _prepareCompletionAt(int offset) async { |
125 Request request = | 124 Request request = |
126 new EditGetStatementCompletionParams(testFile, offset).toRequest('0'); | 125 new EditGetStatementCompletionParams(testFile, offset).toRequest('0'); |
127 Response response = await waitResponse(request); | 126 Response response = await waitResponse(request); |
128 var result = new EditGetStatementCompletionResult.fromResponse(response); | 127 var result = new EditGetStatementCompletionResult.fromResponse(response); |
129 change = result.change; | 128 change = result.change; |
130 } | 129 } |
131 } | 130 } |
OLD | NEW |