| 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 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/constants.dart'; | 12 import 'package:analysis_server/src/constants.dart'; |
| 13 import 'package:analysis_server/src/domain_analysis.dart'; | 13 import 'package:analysis_server/src/domain_analysis.dart'; |
| 14 import 'package:analysis_server/src/plugin/linter_plugin.dart'; | 14 import 'package:analysis_server/src/plugin/linter_plugin.dart'; |
| 15 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 15 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 16 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; | 16 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
| 17 import 'package:analysis_server/src/services/index/index.dart'; | 17 import 'package:analysis_server/src/services/index/index.dart'; |
| 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:linter/src/plugin/linter_plugin.dart'; | |
| 25 import 'package:plugin/manager.dart'; | 24 import 'package:plugin/manager.dart'; |
| 26 import 'package:plugin/plugin.dart'; | 25 import 'package:plugin/plugin.dart'; |
| 27 import 'package:test/test.dart'; | 26 import 'package:test/test.dart'; |
| 28 | 27 |
| 29 import 'mock_sdk.dart'; | 28 import 'mock_sdk.dart'; |
| 30 import 'mocks.dart'; | 29 import 'mocks.dart'; |
| 31 | 30 |
| 32 int findIdentifierLength(String search) { | 31 int findIdentifierLength(String search) { |
| 33 int length = 0; | 32 int length = 0; |
| 34 while (length < search.length) { | 33 while (length < search.length) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // | 117 // |
| 119 // Collect plugins | 118 // Collect plugins |
| 120 // | 119 // |
| 121 ServerPlugin serverPlugin = new ServerPlugin(); | 120 ServerPlugin serverPlugin = new ServerPlugin(); |
| 122 List<Plugin> plugins = <Plugin>[]; | 121 List<Plugin> plugins = <Plugin>[]; |
| 123 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 122 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
| 124 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 123 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
| 125 plugins.add(AnalysisEngine.instance.optionsPlugin); | 124 plugins.add(AnalysisEngine.instance.optionsPlugin); |
| 126 plugins.add(serverPlugin); | 125 plugins.add(serverPlugin); |
| 127 plugins.add(dartCompletionPlugin); | 126 plugins.add(dartCompletionPlugin); |
| 128 plugins.add(linterPlugin); | |
| 129 plugins.add(linterServerPlugin); | 127 plugins.add(linterServerPlugin); |
| 130 addServerPlugins(plugins); | 128 addServerPlugins(plugins); |
| 131 // | 129 // |
| 132 // Process plugins | 130 // Process plugins |
| 133 // | 131 // |
| 134 ExtensionManager manager = new ExtensionManager(); | 132 ExtensionManager manager = new ExtensionManager(); |
| 135 manager.processPlugins(plugins); | 133 manager.processPlugins(plugins); |
| 136 // | 134 // |
| 137 // Create an SDK in the mock file system. | 135 // Create an SDK in the mock file system. |
| 138 // | 136 // |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 254 } |
| 257 | 255 |
| 258 /** | 256 /** |
| 259 * Completes with a successful [Response] for the given [request]. | 257 * Completes with a successful [Response] for the given [request]. |
| 260 * Otherwise fails. | 258 * Otherwise fails. |
| 261 */ | 259 */ |
| 262 Future<Response> waitResponse(Request request) async { | 260 Future<Response> waitResponse(Request request) async { |
| 263 return serverChannel.sendRequest(request); | 261 return serverChannel.sendRequest(request); |
| 264 } | 262 } |
| 265 } | 263 } |
| OLD | NEW |