| 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 import 'dart:io'; | 6 import 'dart:io'; |
| 7 import 'dart:math'; | 7 import 'dart:math'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 */ | 300 */ |
| 301 ResolverProvider fileResolverProvider; | 301 ResolverProvider fileResolverProvider; |
| 302 | 302 |
| 303 /** | 303 /** |
| 304 * The package resolver provider used to override the way package URI's are | 304 * The package resolver provider used to override the way package URI's are |
| 305 * resolved in some contexts. | 305 * resolved in some contexts. |
| 306 */ | 306 */ |
| 307 ResolverProvider packageResolverProvider; | 307 ResolverProvider packageResolverProvider; |
| 308 | 308 |
| 309 /** | 309 /** |
| 310 * If this flag is `true`, then single analysis context should be used for | |
| 311 * analysis of multiple analysis roots, special files that could otherwise | |
| 312 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`, | |
| 313 * or analysis options are ignored. | |
| 314 */ | |
| 315 bool useSingleContextManager = false; | |
| 316 | |
| 317 /** | |
| 318 * The plugins that are defined outside the analysis_server package. | 310 * The plugins that are defined outside the analysis_server package. |
| 319 */ | 311 */ |
| 320 List<Plugin> _userDefinedPlugins = <Plugin>[]; | 312 List<Plugin> _userDefinedPlugins = <Plugin>[]; |
| 321 | 313 |
| 322 SocketServer socketServer; | 314 SocketServer socketServer; |
| 323 | 315 |
| 324 HttpAnalysisServer httpServer; | 316 HttpAnalysisServer httpServer; |
| 325 | 317 |
| 326 StdioAnalysisServer stdioServer; | 318 StdioAnalysisServer stdioServer; |
| 327 | 319 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Create the sockets and start listening for requests. | 438 // Create the sockets and start listening for requests. |
| 447 // | 439 // |
| 448 socketServer = new SocketServer( | 440 socketServer = new SocketServer( |
| 449 analysisServerOptions, | 441 analysisServerOptions, |
| 450 new DartSdkManager(defaultSdkPath, true), | 442 new DartSdkManager(defaultSdkPath, true), |
| 451 defaultSdk, | 443 defaultSdk, |
| 452 instrumentationService, | 444 instrumentationService, |
| 453 diagnosticServer, | 445 diagnosticServer, |
| 454 serverPlugin, | 446 serverPlugin, |
| 455 fileResolverProvider, | 447 fileResolverProvider, |
| 456 packageResolverProvider, | 448 packageResolverProvider); |
| 457 useSingleContextManager); | |
| 458 httpServer = new HttpAnalysisServer(socketServer); | 449 httpServer = new HttpAnalysisServer(socketServer); |
| 459 stdioServer = new StdioAnalysisServer(socketServer); | 450 stdioServer = new StdioAnalysisServer(socketServer); |
| 460 socketServer.userDefinedPlugins = _userDefinedPlugins; | 451 socketServer.userDefinedPlugins = _userDefinedPlugins; |
| 461 | 452 |
| 462 diagnosticServer.httpServer = httpServer; | 453 diagnosticServer.httpServer = httpServer; |
| 463 if (serve_http) { | 454 if (serve_http) { |
| 464 diagnosticServer.startOnPort(port); | 455 diagnosticServer.startOnPort(port); |
| 465 } | 456 } |
| 466 | 457 |
| 467 _captureExceptions(instrumentationService, () { | 458 _captureExceptions(instrumentationService, () { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 637 |
| 647 _DiagnosticServerImpl(); | 638 _DiagnosticServerImpl(); |
| 648 | 639 |
| 649 @override | 640 @override |
| 650 Future<int> getServerPort() => httpServer.serveHttp(); | 641 Future<int> getServerPort() => httpServer.serveHttp(); |
| 651 | 642 |
| 652 Future startOnPort(int port) { | 643 Future startOnPort(int port) { |
| 653 return httpServer.serveHttp(port); | 644 return httpServer.serveHttp(port); |
| 654 } | 645 } |
| 655 } | 646 } |
| OLD | NEW |