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/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
8 import 'package:analysis_server/src/channel/channel.dart'; | 8 import 'package:analysis_server/src/channel/channel.dart'; |
9 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
10 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
(...skipping 25 matching lines...) Expand all Loading... |
36 * The analysis server that was created when a client established a | 36 * The analysis server that was created when a client established a |
37 * connection, or `null` if no such connection has yet been established. | 37 * connection, or `null` if no such connection has yet been established. |
38 */ | 38 */ |
39 AnalysisServer analysisServer; | 39 AnalysisServer analysisServer; |
40 | 40 |
41 /** | 41 /** |
42 * The plugins that are defined outside the analysis_server package. | 42 * The plugins that are defined outside the analysis_server package. |
43 */ | 43 */ |
44 List<Plugin> userDefinedPlugins; | 44 List<Plugin> userDefinedPlugins; |
45 | 45 |
46 SocketServer(this.analysisServerOptions, this.defaultSdk, | 46 SocketServer( |
47 this.instrumentationService, this.serverPlugin, this.contextManager, | 47 this.analysisServerOptions, |
| 48 this.defaultSdk, |
| 49 this.instrumentationService, |
| 50 this.serverPlugin, |
| 51 this.contextManager, |
48 this.packageResolverProvider); | 52 this.packageResolverProvider); |
49 | 53 |
50 /** | 54 /** |
51 * Create an analysis server which will communicate with the client using the | 55 * Create an analysis server which will communicate with the client using the |
52 * given serverChannel. | 56 * given serverChannel. |
53 */ | 57 */ |
54 void createAnalysisServer(ServerCommunicationChannel serverChannel) { | 58 void createAnalysisServer(ServerCommunicationChannel serverChannel) { |
55 if (analysisServer != null) { | 59 if (analysisServer != null) { |
56 RequestError error = new RequestError( | 60 RequestError error = new RequestError( |
57 RequestErrorCode.SERVER_ALREADY_STARTED, "Server already started"); | 61 RequestErrorCode.SERVER_ALREADY_STARTED, "Server already started"); |
(...skipping 15 matching lines...) Expand all Loading... |
73 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); | 77 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); |
74 } | 78 } |
75 | 79 |
76 Index index = null; | 80 Index index = null; |
77 if (!analysisServerOptions.noIndex) { | 81 if (!analysisServerOptions.noIndex) { |
78 index = createLocalFileIndex(); | 82 index = createLocalFileIndex(); |
79 index.contributors = serverPlugin.indexContributors; | 83 index.contributors = serverPlugin.indexContributors; |
80 index.run(); | 84 index.run(); |
81 } | 85 } |
82 | 86 |
83 analysisServer = new AnalysisServer(serverChannel, resourceProvider, | 87 analysisServer = new AnalysisServer( |
84 new PubPackageMapProvider(resourceProvider, defaultSdk), index, | 88 serverChannel, |
85 serverPlugin, analysisServerOptions, defaultSdk, instrumentationService, | 89 resourceProvider, |
| 90 new PubPackageMapProvider(resourceProvider, defaultSdk), |
| 91 index, |
| 92 serverPlugin, |
| 93 analysisServerOptions, |
| 94 defaultSdk, |
| 95 instrumentationService, |
86 contextManager: contextManager, | 96 contextManager: contextManager, |
87 packageResolverProvider: packageResolverProvider, | 97 packageResolverProvider: packageResolverProvider, |
88 rethrowExceptions: false); | 98 rethrowExceptions: false); |
89 analysisServer.userDefinedPlugins = userDefinedPlugins; | 99 analysisServer.userDefinedPlugins = userDefinedPlugins; |
90 } | 100 } |
91 } | 101 } |
OLD | NEW |