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'; |
11 import 'package:analysis_server/src/services/index/index.dart'; | 11 import 'package:analysis_server/src/services/index/index.dart'; |
12 import 'package:analyzer/file_system/physical_file_system.dart'; | 12 import 'package:analyzer/file_system/physical_file_system.dart'; |
13 import 'package:analyzer/instrumentation/instrumentation.dart'; | 13 import 'package:analyzer/instrumentation/instrumentation.dart'; |
14 import 'package:analyzer/plugin/resolver_provider.dart'; | 14 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 15 import 'package:analyzer/source/pub_package_map_provider.dart'; |
15 import 'package:analyzer/src/generated/sdk.dart'; | 16 import 'package:analyzer/src/generated/sdk.dart'; |
16 import 'package:plugin/plugin.dart'; | 17 import 'package:plugin/plugin.dart'; |
17 | 18 |
18 /** | 19 /** |
19 * Instances of the class [SocketServer] implement the common parts of | 20 * Instances of the class [SocketServer] implement the common parts of |
20 * http-based and stdio-based analysis servers. The primary responsibility of | 21 * http-based and stdio-based analysis servers. The primary responsibility of |
21 * the SocketServer is to manage the lifetime of the AnalysisServer and to | 22 * the SocketServer is to manage the lifetime of the AnalysisServer and to |
22 * encode and decode the JSON messages exchanged with the client. | 23 * encode and decode the JSON messages exchanged with the client. |
23 */ | 24 */ |
24 class SocketServer { | 25 class SocketServer { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } else { | 82 } else { |
82 throw new Exception( | 83 throw new Exception( |
83 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); | 84 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); |
84 } | 85 } |
85 | 86 |
86 Index index = null; | 87 Index index = null; |
87 if (!analysisServerOptions.noIndex) { | 88 if (!analysisServerOptions.noIndex) { |
88 index = createMemoryIndex(); | 89 index = createMemoryIndex(); |
89 } | 90 } |
90 | 91 |
91 analysisServer = new AnalysisServer(serverChannel, resourceProvider, index, | 92 analysisServer = new AnalysisServer( |
92 serverPlugin, analysisServerOptions, sdkManager, instrumentationService, | 93 serverChannel, |
| 94 resourceProvider, |
| 95 new PubPackageMapProvider(resourceProvider, defaultSdk), |
| 96 index, |
| 97 serverPlugin, |
| 98 analysisServerOptions, |
| 99 sdkManager, |
| 100 instrumentationService, |
93 fileResolverProvider: fileResolverProvider, | 101 fileResolverProvider: fileResolverProvider, |
94 packageResolverProvider: packageResolverProvider, | 102 packageResolverProvider: packageResolverProvider, |
95 useSingleContextManager: useSingleContextManager, | 103 useSingleContextManager: useSingleContextManager, |
96 rethrowExceptions: false); | 104 rethrowExceptions: false); |
97 analysisServer.userDefinedPlugins = userDefinedPlugins; | 105 analysisServer.userDefinedPlugins = userDefinedPlugins; |
98 } | 106 } |
99 } | 107 } |
OLD | NEW |