| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart' | 7 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 8 hide AnalysisOptions; | 8 hide AnalysisOptions; |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| 11 import 'package:analysis_server/src/domain_analysis.dart'; | 11 import 'package:analysis_server/src/domain_analysis.dart'; |
| 12 import 'package:analysis_server/src/plugin/notification_manager.dart'; | 12 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
| 13 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 13 import 'package:analysis_server/src/plugin/plugin_manager.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/provisional/completion/dart/completion_plugi
n.dart'; |
| 16 import 'package:analysis_server/src/services/index/index.dart'; | 16 import 'package:analysis_server/src/services/index/index.dart'; |
| 17 import 'package:analyzer/context/context_root.dart' as analyzer; | 17 import 'package:analyzer/context/context_root.dart' as analyzer; |
| 18 import 'package:analyzer/file_system/file_system.dart'; | 18 import 'package:analyzer/file_system/file_system.dart'; |
| 19 import 'package:analyzer/file_system/memory_file_system.dart'; | 19 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 20 import 'package:analyzer/instrumentation/instrumentation.dart'; | 20 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 21 import 'package:analyzer/src/dart/analysis/driver.dart'; | 21 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 22 import 'package:analyzer/src/generated/engine.dart'; | 22 import 'package:analyzer/src/generated/engine.dart'; |
| 23 import 'package:analyzer/src/generated/sdk.dart'; | 23 import 'package:analyzer/src/generated/sdk.dart'; |
| 24 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; | 24 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; |
| 25 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
| 25 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; | 26 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; |
| 26 import 'package:plugin/manager.dart'; | 27 import 'package:plugin/manager.dart'; |
| 27 import 'package:plugin/plugin.dart'; | 28 import 'package:plugin/plugin.dart'; |
| 28 import 'package:test/test.dart'; | 29 import 'package:test/test.dart'; |
| 29 | 30 |
| 30 import 'mock_sdk.dart'; | 31 import 'mock_sdk.dart'; |
| 31 import 'mocks.dart'; | 32 import 'mocks.dart'; |
| 32 | 33 |
| 33 int findIdentifierLength(String search) { | 34 int findIdentifierLength(String search) { |
| 34 int length = 0; | 35 int length = 0; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 Future<Response> waitResponse(Request request) async { | 264 Future<Response> waitResponse(Request request) async { |
| 264 return serverChannel.sendRequest(request); | 265 return serverChannel.sendRequest(request); |
| 265 } | 266 } |
| 266 } | 267 } |
| 267 | 268 |
| 268 /** | 269 /** |
| 269 * A plugin manager that simulates broadcasting requests to plugins by | 270 * A plugin manager that simulates broadcasting requests to plugins by |
| 270 * hard-coding the responses. | 271 * hard-coding the responses. |
| 271 */ | 272 */ |
| 272 class TestPluginManager implements PluginManager { | 273 class TestPluginManager implements PluginManager { |
| 274 plugin.AnalysisSetPriorityFilesParams analysisSetPriorityFilesParams; |
| 275 plugin.AnalysisSetSubscriptionsParams analysisSetSubscriptionsParams; |
| 276 plugin.AnalysisUpdateContentParams analysisUpdateContentParams; |
| 273 Map<PluginInfo, Future<plugin.Response>> broadcastResults; | 277 Map<PluginInfo, Future<plugin.Response>> broadcastResults; |
| 274 | 278 |
| 275 @override | 279 @override |
| 276 String get byteStorePath { | 280 String get byteStorePath { |
| 277 fail('Unexpected invocation of byteStorePath'); | 281 fail('Unexpected invocation of byteStorePath'); |
| 278 return null; | 282 return null; |
| 279 } | 283 } |
| 280 | 284 |
| 281 @override | 285 @override |
| 282 InstrumentationService get instrumentationService { | 286 InstrumentationService get instrumentationService { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 fail('Unexpected invocation of pluginsForContextRoot'); | 318 fail('Unexpected invocation of pluginsForContextRoot'); |
| 315 return null; | 319 return null; |
| 316 } | 320 } |
| 317 | 321 |
| 318 @override | 322 @override |
| 319 void removedContextRoot(analyzer.ContextRoot contextRoot) { | 323 void removedContextRoot(analyzer.ContextRoot contextRoot) { |
| 320 fail('Unexpected invocation of removedContextRoot'); | 324 fail('Unexpected invocation of removedContextRoot'); |
| 321 } | 325 } |
| 322 | 326 |
| 323 @override | 327 @override |
| 328 void setAnalysisSetPriorityFilesParams( |
| 329 plugin.AnalysisSetPriorityFilesParams params) { |
| 330 analysisSetPriorityFilesParams = params; |
| 331 } |
| 332 |
| 333 @override |
| 334 void setAnalysisSetSubscriptionsParams( |
| 335 plugin.AnalysisSetSubscriptionsParams params) { |
| 336 analysisSetSubscriptionsParams = params; |
| 337 } |
| 338 |
| 339 @override |
| 340 void setAnalysisUpdateContentParams( |
| 341 plugin.AnalysisUpdateContentParams params) { |
| 342 analysisUpdateContentParams = params; |
| 343 } |
| 344 |
| 345 @override |
| 324 Future<List<Null>> stopAll() async { | 346 Future<List<Null>> stopAll() async { |
| 325 fail('Unexpected invocation of stopAll'); | 347 fail('Unexpected invocation of stopAll'); |
| 326 return null; | 348 return null; |
| 327 } | 349 } |
| 328 } | 350 } |
| OLD | NEW |