| 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 socket.server; | 5 library socket.server; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/src/analysis_server.dart'; | 8 import 'package:analysis_server/src/analysis_server.dart'; |
| 9 import 'package:analysis_server/src/channel/channel.dart'; | 9 import 'package:analysis_server/src/channel/channel.dart'; |
| 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 final AnalysisServerOptions analysisServerOptions; | 27 final AnalysisServerOptions analysisServerOptions; |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * The function used to create a new SDK using the default SDK. | 30 * The function used to create a new SDK using the default SDK. |
| 31 */ | 31 */ |
| 32 final SdkCreator defaultSdkCreator; | 32 final SdkCreator defaultSdkCreator; |
| 33 | 33 |
| 34 final DirectoryBasedDartSdk defaultSdk; | 34 final DirectoryBasedDartSdk defaultSdk; |
| 35 final InstrumentationService instrumentationService; | 35 final InstrumentationService instrumentationService; |
| 36 final ServerPlugin serverPlugin; | 36 final ServerPlugin serverPlugin; |
| 37 final ResolverProvider fileResolverProvider; |
| 37 final ResolverProvider packageResolverProvider; | 38 final ResolverProvider packageResolverProvider; |
| 38 final bool useSingleContextManager; | 39 final bool useSingleContextManager; |
| 39 | 40 |
| 40 /** | 41 /** |
| 41 * The analysis server that was created when a client established a | 42 * The analysis server that was created when a client established a |
| 42 * connection, or `null` if no such connection has yet been established. | 43 * connection, or `null` if no such connection has yet been established. |
| 43 */ | 44 */ |
| 44 AnalysisServer analysisServer; | 45 AnalysisServer analysisServer; |
| 45 | 46 |
| 46 /** | 47 /** |
| 47 * The plugins that are defined outside the analysis_server package. | 48 * The plugins that are defined outside the analysis_server package. |
| 48 */ | 49 */ |
| 49 List<Plugin> userDefinedPlugins; | 50 List<Plugin> userDefinedPlugins; |
| 50 | 51 |
| 51 SocketServer( | 52 SocketServer( |
| 52 this.analysisServerOptions, | 53 this.analysisServerOptions, |
| 53 this.defaultSdkCreator, | 54 this.defaultSdkCreator, |
| 54 this.defaultSdk, | 55 this.defaultSdk, |
| 55 this.instrumentationService, | 56 this.instrumentationService, |
| 56 this.serverPlugin, | 57 this.serverPlugin, |
| 58 this.fileResolverProvider, |
| 57 this.packageResolverProvider, | 59 this.packageResolverProvider, |
| 58 this.useSingleContextManager); | 60 this.useSingleContextManager); |
| 59 | 61 |
| 60 /** | 62 /** |
| 61 * Create an analysis server which will communicate with the client using the | 63 * Create an analysis server which will communicate with the client using the |
| 62 * given serverChannel. | 64 * given serverChannel. |
| 63 */ | 65 */ |
| 64 void createAnalysisServer(ServerCommunicationChannel serverChannel) { | 66 void createAnalysisServer(ServerCommunicationChannel serverChannel) { |
| 65 if (analysisServer != null) { | 67 if (analysisServer != null) { |
| 66 RequestError error = new RequestError( | 68 RequestError error = new RequestError( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 | 92 |
| 91 analysisServer = new AnalysisServer( | 93 analysisServer = new AnalysisServer( |
| 92 serverChannel, | 94 serverChannel, |
| 93 resourceProvider, | 95 resourceProvider, |
| 94 new PubPackageMapProvider(resourceProvider, defaultSdk), | 96 new PubPackageMapProvider(resourceProvider, defaultSdk), |
| 95 index, | 97 index, |
| 96 serverPlugin, | 98 serverPlugin, |
| 97 analysisServerOptions, | 99 analysisServerOptions, |
| 98 defaultSdkCreator, | 100 defaultSdkCreator, |
| 99 instrumentationService, | 101 instrumentationService, |
| 102 fileResolverProvider: fileResolverProvider, |
| 100 packageResolverProvider: packageResolverProvider, | 103 packageResolverProvider: packageResolverProvider, |
| 101 useSingleContextManager: useSingleContextManager, | 104 useSingleContextManager: useSingleContextManager, |
| 102 rethrowExceptions: false); | 105 rethrowExceptions: false); |
| 103 analysisServer.userDefinedPlugins = userDefinedPlugins; | 106 analysisServer.userDefinedPlugins = userDefinedPlugins; |
| 104 } | 107 } |
| 105 } | 108 } |
| OLD | NEW |