| 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.domain.analysis.abstract; | 5 library test.domain.analysis.abstract; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| 11 import 'package:analysis_server/src/constants.dart'; | 11 import 'package:analysis_server/src/constants.dart'; |
| 12 import 'package:analysis_server/src/domain_analysis.dart'; | 12 import 'package:analysis_server/src/domain_analysis.dart'; |
| 13 import 'package:analysis_server/src/plugin/linter_plugin.dart'; | 13 import 'package:analysis_server/src/plugin/linter_plugin.dart'; |
| 14 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 14 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 15 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
| 15 import 'package:analysis_server/src/services/index/index.dart'; | 16 import 'package:analysis_server/src/services/index/index.dart'; |
| 16 import 'package:analyzer/file_system/file_system.dart'; | 17 import 'package:analyzer/file_system/file_system.dart'; |
| 17 import 'package:analyzer/file_system/memory_file_system.dart'; | 18 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 18 import 'package:analyzer/instrumentation/instrumentation.dart'; | 19 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 19 import 'package:analyzer/src/generated/engine.dart'; | 20 import 'package:analyzer/src/generated/engine.dart'; |
| 20 import 'package:linter/src/plugin/linter_plugin.dart'; | 21 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 21 import 'package:plugin/manager.dart'; | 22 import 'package:plugin/manager.dart'; |
| 22 import 'package:plugin/plugin.dart'; | 23 import 'package:plugin/plugin.dart'; |
| 23 import 'package:unittest/unittest.dart'; | 24 import 'package:unittest/unittest.dart'; |
| 24 | 25 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 this.testCode = content; | 95 this.testCode = content; |
| 95 return testFile; | 96 return testFile; |
| 96 } | 97 } |
| 97 | 98 |
| 98 AnalysisServer createAnalysisServer(Index index) { | 99 AnalysisServer createAnalysisServer(Index index) { |
| 99 ServerPlugin serverPlugin = new ServerPlugin(); | 100 ServerPlugin serverPlugin = new ServerPlugin(); |
| 100 // TODO(pq): this convoluted extension registry dance needs cleanup. | 101 // TODO(pq): this convoluted extension registry dance needs cleanup. |
| 101 List<Plugin> plugins = <Plugin>[ | 102 List<Plugin> plugins = <Plugin>[ |
| 102 serverPlugin, | 103 serverPlugin, |
| 103 linterPlugin, | 104 linterPlugin, |
| 104 linterServerPlugin | 105 linterServerPlugin, |
| 106 dartCompletionPlugin, |
| 105 ]; | 107 ]; |
| 106 // Accessing `taskManager` ensures that AE plugins are registered. | 108 // Accessing `taskManager` ensures that AE plugins are registered. |
| 107 AnalysisEngine.instance.taskManager; | 109 AnalysisEngine.instance.taskManager; |
| 108 plugins.addAll(AnalysisEngine.instance.supportedPlugins); | 110 plugins.addAll(AnalysisEngine.instance.supportedPlugins); |
| 109 addServerPlugins(plugins); | 111 addServerPlugins(plugins); |
| 110 // process plugins | 112 // process plugins |
| 111 ExtensionManager manager = new ExtensionManager(); | 113 ExtensionManager manager = new ExtensionManager(); |
| 112 manager.processPlugins(plugins); | 114 manager.processPlugins(plugins); |
| 113 // create server | 115 // create server |
| 114 return new AnalysisServer( | 116 return new AnalysisServer( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 221 } |
| 220 | 222 |
| 221 /** | 223 /** |
| 222 * Completes with a successful [Response] for the given [request]. | 224 * Completes with a successful [Response] for the given [request]. |
| 223 * Otherwise fails. | 225 * Otherwise fails. |
| 224 */ | 226 */ |
| 225 Future<Response> waitResponse(Request request) async { | 227 Future<Response> waitResponse(Request request) async { |
| 226 return serverChannel.sendRequest(request); | 228 return serverChannel.sendRequest(request); |
| 227 } | 229 } |
| 228 } | 230 } |
| OLD | NEW |