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