| 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/server_plugin.dart'; | 14 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 14 import 'package:analysis_server/src/services/index/index.dart'; | 15 import 'package:analysis_server/src/services/index/index.dart'; |
| 15 import 'package:analyzer/file_system/file_system.dart'; | 16 import 'package:analyzer/file_system/file_system.dart'; |
| 16 import 'package:analyzer/file_system/memory_file_system.dart'; | 17 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 17 import 'package:analyzer/instrumentation/instrumentation.dart'; | 18 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 18 import 'package:analyzer/src/generated/engine.dart'; | 19 import 'package:analyzer/src/generated/engine.dart'; |
| 19 import 'package:linter/src/plugin/linter_plugin.dart'; | 20 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 20 import 'package:plugin/manager.dart'; | 21 import 'package:plugin/manager.dart'; |
| 21 import 'package:plugin/plugin.dart'; | 22 import 'package:plugin/plugin.dart'; |
| 22 import 'package:unittest/unittest.dart'; | 23 import 'package:unittest/unittest.dart'; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 91 |
| 91 String addTestFile(String content) { | 92 String addTestFile(String content) { |
| 92 addFile(testFile, content); | 93 addFile(testFile, content); |
| 93 this.testCode = content; | 94 this.testCode = content; |
| 94 return testFile; | 95 return testFile; |
| 95 } | 96 } |
| 96 | 97 |
| 97 AnalysisServer createAnalysisServer(Index index) { | 98 AnalysisServer createAnalysisServer(Index index) { |
| 98 ServerPlugin serverPlugin = new ServerPlugin(); | 99 ServerPlugin serverPlugin = new ServerPlugin(); |
| 99 // TODO(pq): this convoluted extension registry dance needs cleanup. | 100 // TODO(pq): this convoluted extension registry dance needs cleanup. |
| 100 List<Plugin> plugins = <Plugin>[serverPlugin, linterPlugin]; | 101 List<Plugin> plugins = <Plugin>[ |
| 102 serverPlugin, |
| 103 linterPlugin, |
| 104 linterServerPlugin |
| 105 ]; |
| 101 // Accessing `taskManager` ensures that AE plugins are registered. | 106 // Accessing `taskManager` ensures that AE plugins are registered. |
| 102 AnalysisEngine.instance.taskManager; | 107 AnalysisEngine.instance.taskManager; |
| 103 plugins.addAll(AnalysisEngine.instance.supportedPlugins); | 108 plugins.addAll(AnalysisEngine.instance.supportedPlugins); |
| 104 addServerPlugins(plugins); | 109 addServerPlugins(plugins); |
| 105 // process plugins | 110 // process plugins |
| 106 ExtensionManager manager = new ExtensionManager(); | 111 ExtensionManager manager = new ExtensionManager(); |
| 107 manager.processPlugins(plugins); | 112 manager.processPlugins(plugins); |
| 108 // create server | 113 // create server |
| 109 return new AnalysisServer( | 114 return new AnalysisServer( |
| 110 serverChannel, | 115 serverChannel, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 219 } |
| 215 | 220 |
| 216 /** | 221 /** |
| 217 * Completes with a successful [Response] for the given [request]. | 222 * Completes with a successful [Response] for the given [request]. |
| 218 * Otherwise fails. | 223 * Otherwise fails. |
| 219 */ | 224 */ |
| 220 Future<Response> waitResponse(Request request) async { | 225 Future<Response> waitResponse(Request request) async { |
| 221 return serverChannel.sendRequest(request); | 226 return serverChannel.sendRequest(request); |
| 222 } | 227 } |
| 223 } | 228 } |
| OLD | NEW |