| 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/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart' | 9 import 'package:analysis_server/protocol/protocol_generated.dart' |
| 10 hide AnalysisOptions; | 10 hide AnalysisOptions; |
| 11 import 'package:analysis_server/src/analysis_server.dart'; | 11 import 'package:analysis_server/src/analysis_server.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/notification_manager.dart'; | 13 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
| 14 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 14 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
| 15 import 'package:analyzer/context/context_root.dart' as analyzer; | 15 import 'package:analyzer/context/context_root.dart' as analyzer; |
| 16 import 'package:analyzer/file_system/file_system.dart'; | 16 import 'package:analyzer/file_system/file_system.dart'; |
| 17 import 'package:analyzer/file_system/memory_file_system.dart'; | 17 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 18 import 'package:analyzer/instrumentation/instrumentation.dart'; | 18 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 19 import 'package:analyzer/src/dart/analysis/driver.dart'; | 19 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 20 import 'package:analyzer/src/generated/engine.dart'; | 20 import 'package:analyzer/src/generated/engine.dart'; |
| 21 import 'package:analyzer/src/generated/sdk.dart'; | 21 import 'package:analyzer/src/generated/sdk.dart'; |
| 22 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; | 22 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; |
| 23 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; | 23 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
| 24 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; | 24 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin; |
| 25 import 'package:plugin/manager.dart'; | 25 import 'package:plugin/manager.dart'; |
| 26 import 'package:plugin/plugin.dart'; | |
| 27 import 'package:test/test.dart'; | 26 import 'package:test/test.dart'; |
| 28 import 'package:watcher/watcher.dart'; | 27 import 'package:watcher/watcher.dart'; |
| 29 | 28 |
| 30 import 'mock_sdk.dart'; | 29 import 'mock_sdk.dart'; |
| 31 import 'mocks.dart'; | 30 import 'mocks.dart'; |
| 32 | 31 |
| 33 int findIdentifierLength(String search) { | 32 int findIdentifierLength(String search) { |
| 34 int length = 0; | 33 int length = 0; |
| 35 while (length < search.length) { | 34 while (length < search.length) { |
| 36 int c = search.codeUnitAt(length); | 35 int c = search.codeUnitAt(length); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 103 } |
| 105 | 104 |
| 106 String addTestFile(String content) { | 105 String addTestFile(String content) { |
| 107 addFile(testFile, content); | 106 addFile(testFile, content); |
| 108 this.testCode = content; | 107 this.testCode = content; |
| 109 return testFile; | 108 return testFile; |
| 110 } | 109 } |
| 111 | 110 |
| 112 AnalysisServer createAnalysisServer() { | 111 AnalysisServer createAnalysisServer() { |
| 113 // | 112 // |
| 114 // Collect plugins | |
| 115 // | |
| 116 List<Plugin> plugins = <Plugin>[]; | |
| 117 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | |
| 118 // | |
| 119 // Process plugins | 113 // Process plugins |
| 120 // | 114 // |
| 121 ExtensionManager manager = new ExtensionManager(); | 115 ExtensionManager manager = new ExtensionManager(); |
| 122 manager.processPlugins(plugins); | 116 manager.processPlugins(AnalysisEngine.instance.requiredPlugins); |
| 123 // | 117 // |
| 124 // Create an SDK in the mock file system. | 118 // Create an SDK in the mock file system. |
| 125 // | 119 // |
| 126 new MockSdk( | 120 new MockSdk( |
| 127 generateSummaryFiles: generateSummaryFiles, | 121 generateSummaryFiles: generateSummaryFiles, |
| 128 resourceProvider: resourceProvider); | 122 resourceProvider: resourceProvider); |
| 129 // | 123 // |
| 130 // Create server | 124 // Create server |
| 131 // | 125 // |
| 132 AnalysisServerOptions options = new AnalysisServerOptions(); | 126 AnalysisServerOptions options = new AnalysisServerOptions(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 plugin.AnalysisUpdateContentParams params) { | 353 plugin.AnalysisUpdateContentParams params) { |
| 360 analysisUpdateContentParams = params; | 354 analysisUpdateContentParams = params; |
| 361 } | 355 } |
| 362 | 356 |
| 363 @override | 357 @override |
| 364 Future<List<Null>> stopAll() async { | 358 Future<List<Null>> stopAll() async { |
| 365 fail('Unexpected invocation of stopAll'); | 359 fail('Unexpected invocation of stopAll'); |
| 366 return null; | 360 return null; |
| 367 } | 361 } |
| 368 } | 362 } |
| OLD | NEW |