| 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'; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 void addServerPlugins(List<Plugin> plugins) {} | 90 void addServerPlugins(List<Plugin> plugins) {} |
| 91 | 91 |
| 92 String addTestFile(String content) { | 92 String addTestFile(String content) { |
| 93 addFile(testFile, content); | 93 addFile(testFile, content); |
| 94 this.testCode = content; | 94 this.testCode = content; |
| 95 return testFile; | 95 return testFile; |
| 96 } | 96 } |
| 97 | 97 |
| 98 AnalysisServer createAnalysisServer(Index index) { | 98 AnalysisServer createAnalysisServer(Index index) { |
| 99 // |
| 100 // Collect plugins |
| 101 // |
| 99 ServerPlugin serverPlugin = new ServerPlugin(); | 102 ServerPlugin serverPlugin = new ServerPlugin(); |
| 100 // TODO(pq): this convoluted extension registry dance needs cleanup. | 103 List<Plugin> plugins = <Plugin>[]; |
| 101 List<Plugin> plugins = <Plugin>[ | |
| 102 serverPlugin, | |
| 103 linterPlugin, | |
| 104 linterServerPlugin | |
| 105 ]; | |
| 106 // Accessing `taskManager` ensures that AE plugins are registered. | |
| 107 AnalysisEngine.instance.taskManager; | |
| 108 plugins.addAll(AnalysisEngine.instance.supportedPlugins); | 104 plugins.addAll(AnalysisEngine.instance.supportedPlugins); |
| 105 plugins.add(serverPlugin); |
| 106 plugins.add(linterPlugin); |
| 107 plugins.add(linterServerPlugin); |
| 109 addServerPlugins(plugins); | 108 addServerPlugins(plugins); |
| 110 // process plugins | 109 // |
| 110 // Process plugins |
| 111 // |
| 111 ExtensionManager manager = new ExtensionManager(); | 112 ExtensionManager manager = new ExtensionManager(); |
| 112 manager.processPlugins(plugins); | 113 manager.processPlugins(plugins); |
| 113 // create server | 114 // |
| 115 // Create server |
| 116 // |
| 114 return new AnalysisServer( | 117 return new AnalysisServer( |
| 115 serverChannel, | 118 serverChannel, |
| 116 resourceProvider, | 119 resourceProvider, |
| 117 packageMapProvider, | 120 packageMapProvider, |
| 118 index, | 121 index, |
| 119 serverPlugin, | 122 serverPlugin, |
| 120 new AnalysisServerOptions(), | 123 new AnalysisServerOptions(), |
| 121 new MockSdk(), | 124 new MockSdk(), |
| 122 InstrumentationService.NULL_SERVICE); | 125 InstrumentationService.NULL_SERVICE); |
| 123 } | 126 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 222 } |
| 220 | 223 |
| 221 /** | 224 /** |
| 222 * Completes with a successful [Response] for the given [request]. | 225 * Completes with a successful [Response] for the given [request]. |
| 223 * Otherwise fails. | 226 * Otherwise fails. |
| 224 */ | 227 */ |
| 225 Future<Response> waitResponse(Request request) async { | 228 Future<Response> waitResponse(Request request) async { |
| 226 return serverChannel.sendRequest(request); | 229 return serverChannel.sendRequest(request); |
| 227 } | 230 } |
| 228 } | 231 } |
| OLD | NEW |