| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analysis_server.starter; | 5 import 'package:analysis_server/src/analysis_server.dart'; |
| 6 | |
| 7 import 'package:analysis_server/src/server/driver.dart'; | 6 import 'package:analysis_server/src/server/driver.dart'; |
| 8 import 'package:analysis_server/src/analysis_server.dart'; | |
| 9 import 'package:analyzer/instrumentation/instrumentation.dart'; | 7 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 10 import 'package:analyzer/plugin/resolver_provider.dart'; | 8 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 11 import 'package:plugin/plugin.dart'; | 9 import 'package:plugin/plugin.dart'; |
| 12 | 10 |
| 13 /** | 11 /** |
| 14 * An object that can be used to start an analysis server. This class exists so | 12 * An object that can be used to start an analysis server. This class exists so |
| 15 * that clients can configure an analysis server before starting it. | 13 * that clients can configure an analysis server before starting it. |
| 16 * | 14 * |
| 17 * Clients may not extend, implement or mix-in this class. | 15 * Clients may not extend, implement or mix-in this class. |
| 18 */ | 16 */ |
| 19 abstract class ServerStarter { | 17 abstract class ServerStarter { |
| 20 /** | 18 /** |
| 21 * Initialize a newly created starter to start up an analysis server. | 19 * Initialize a newly created starter to start up an analysis server. |
| 22 */ | 20 */ |
| 23 factory ServerStarter() = Driver; | 21 factory ServerStarter() = Driver; |
| 24 | 22 |
| 25 /** | 23 /** |
| 26 * Set the instrumentation [server] that is to be used by the analysis server. | |
| 27 */ | |
| 28 void set instrumentationServer(InstrumentationServer server); | |
| 29 | |
| 30 /** | |
| 31 * Set the file resolver provider used to override the way file URI's | 24 * Set the file resolver provider used to override the way file URI's |
| 32 * are resolved in some contexts. The provider should return `null` if the | 25 * are resolved in some contexts. The provider should return `null` if the |
| 33 * default file resolution scheme should be used instead. | 26 * default file resolution scheme should be used instead. |
| 34 */ | 27 */ |
| 35 void set fileResolverProvider(ResolverProvider provider); | 28 void set fileResolverProvider(ResolverProvider provider); |
| 36 | 29 |
| 37 /** | 30 /** |
| 31 * Set the instrumentation [server] that is to be used by the analysis server. |
| 32 */ |
| 33 void set instrumentationServer(InstrumentationServer server); |
| 34 |
| 35 /** |
| 38 * Set the package resolver provider used to override the way package URI's | 36 * Set the package resolver provider used to override the way package URI's |
| 39 * are resolved in some contexts. The provider should return `null` if the | 37 * are resolved in some contexts. The provider should return `null` if the |
| 40 * default package resolution scheme should be used instead. | 38 * default package resolution scheme should be used instead. |
| 41 */ | 39 */ |
| 42 void set packageResolverProvider(ResolverProvider provider); | 40 void set packageResolverProvider(ResolverProvider provider); |
| 43 | 41 |
| 44 /** | 42 /** |
| 45 * Set the [plugins] that are defined outside the analysis_server package. | 43 * Set the [plugins] that are defined outside the analysis_server package. |
| 46 */ | 44 */ |
| 47 void set userDefinedPlugins(List<Plugin> plugins); | 45 void set userDefinedPlugins(List<Plugin> plugins); |
| 48 | 46 |
| 49 /** | 47 /** |
| 50 * Use the given command-line [arguments] to start this server. | 48 * Use the given command-line [arguments] to start this server. |
| 51 * | 49 * |
| 52 * At least temporarily returns AnalysisServer so that consumers of the | 50 * At least temporarily returns AnalysisServer so that consumers of the |
| 53 * starter API can then use the server, this is done as a stopgap for the | 51 * starter API can then use the server, this is done as a stopgap for the |
| 54 * angular plugin until the official plugin API is finished. | 52 * angular plugin until the official plugin API is finished. |
| 55 */ | 53 */ |
| 56 AnalysisServer start(List<String> arguments); | 54 AnalysisServer start(List<String> arguments); |
| 57 } | 55 } |
| OLD | NEW |