| 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 driver; | 5 library driver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:math'; | 9 import 'dart:math'; |
| 10 | 10 |
| 11 import 'package:analysis_server/plugin/analysis/resolver_provider.dart'; | 11 import 'package:analysis_server/plugin/analysis/resolver_provider.dart'; |
| 12 import 'package:analysis_server/src/analysis_server.dart'; | 12 import 'package:analysis_server/src/analysis_server.dart'; |
| 13 import 'package:analysis_server/src/plugin/linter_plugin.dart'; |
| 13 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 14 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 14 import 'package:analysis_server/src/server/http_server.dart'; | 15 import 'package:analysis_server/src/server/http_server.dart'; |
| 15 import 'package:analysis_server/src/server/stdio_server.dart'; | 16 import 'package:analysis_server/src/server/stdio_server.dart'; |
| 16 import 'package:analysis_server/src/socket_server.dart'; | 17 import 'package:analysis_server/src/socket_server.dart'; |
| 17 import 'package:analysis_server/starter.dart'; | 18 import 'package:analysis_server/starter.dart'; |
| 18 import 'package:analyzer/file_system/physical_file_system.dart'; | 19 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 19 import 'package:analyzer/instrumentation/file_instrumentation.dart'; | 20 import 'package:analyzer/instrumentation/file_instrumentation.dart'; |
| 20 import 'package:analyzer/instrumentation/instrumentation.dart'; | 21 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 21 import 'package:analyzer/src/generated/engine.dart'; | 22 import 'package:analyzer/src/generated/engine.dart'; |
| 22 import 'package:analyzer/src/generated/incremental_logger.dart'; | 23 import 'package:analyzer/src/generated/incremental_logger.dart'; |
| 23 import 'package:analyzer/src/generated/java_io.dart'; | 24 import 'package:analyzer/src/generated/java_io.dart'; |
| 24 import 'package:analyzer/src/generated/sdk.dart'; | 25 import 'package:analyzer/src/generated/sdk.dart'; |
| 25 import 'package:analyzer/src/generated/sdk_io.dart'; | 26 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 26 import 'package:args/args.dart'; | 27 import 'package:args/args.dart'; |
| 27 import 'package:linter/src/plugin/linter_plugin.dart'; | 28 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 28 import 'package:plugin/manager.dart'; | |
| 29 import 'package:plugin/plugin.dart'; | 29 import 'package:plugin/plugin.dart'; |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Initializes incremental logger. | 32 * Initializes incremental logger. |
| 33 * | 33 * |
| 34 * Supports following formats of [spec]: | 34 * Supports following formats of [spec]: |
| 35 * | 35 * |
| 36 * "console" - log to the console; | 36 * "console" - log to the console; |
| 37 * "file:/some/file/name" - log to the file, overwritten on start. | 37 * "file:/some/file/name" - log to the file, overwritten on start. |
| 38 */ | 38 */ |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // | 400 // |
| 401 AnalysisEngine.instance.useTaskModel = !results[DISABLE_NEW_TASK_MODEL]; | 401 AnalysisEngine.instance.useTaskModel = !results[DISABLE_NEW_TASK_MODEL]; |
| 402 // | 402 // |
| 403 // Process all of the plugins so that extensions are registered. | 403 // Process all of the plugins so that extensions are registered. |
| 404 // | 404 // |
| 405 ServerPlugin serverPlugin = new ServerPlugin(); | 405 ServerPlugin serverPlugin = new ServerPlugin(); |
| 406 List<Plugin> plugins = <Plugin>[]; | 406 List<Plugin> plugins = <Plugin>[]; |
| 407 plugins.add(serverPlugin); | 407 plugins.add(serverPlugin); |
| 408 plugins.addAll(_userDefinedPlugins); | 408 plugins.addAll(_userDefinedPlugins); |
| 409 plugins.add(linterPlugin); | 409 plugins.add(linterPlugin); |
| 410 plugins.add(linterServerPlugin); |
| 410 | 411 |
| 411 // Defer to the extension manager in AE for plugin registration. | 412 // Defer to the extension manager in AE for plugin registration. |
| 412 AnalysisEngine.instance.userDefinedPlugins = plugins; | 413 AnalysisEngine.instance.userDefinedPlugins = plugins; |
| 413 // Force registration. | 414 // Force registration. |
| 414 AnalysisEngine.instance.taskManager; | 415 AnalysisEngine.instance.taskManager; |
| 415 | 416 |
| 416 // | 417 // |
| 417 // Create the sockets and start listening for requests. | 418 // Create the sockets and start listening for requests. |
| 418 // | 419 // |
| 419 socketServer = new SocketServer(analysisServerOptions, defaultSdk, service, | 420 socketServer = new SocketServer(analysisServerOptions, defaultSdk, service, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 uuidFile.parent.createSync(recursive: true); | 571 uuidFile.parent.createSync(recursive: true); |
| 571 uuidFile.writeAsStringSync(uuid); | 572 uuidFile.writeAsStringSync(uuid); |
| 572 } catch (exception, stackTrace) { | 573 } catch (exception, stackTrace) { |
| 573 service.logPriorityException(exception, stackTrace); | 574 service.logPriorityException(exception, stackTrace); |
| 574 // Slightly alter the uuid to indicate it was not persisted | 575 // Slightly alter the uuid to indicate it was not persisted |
| 575 uuid = 'temp-$uuid'; | 576 uuid = 'temp-$uuid'; |
| 576 } | 577 } |
| 577 return uuid; | 578 return uuid; |
| 578 } | 579 } |
| 579 } | 580 } |
| OLD | NEW |