Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: pkg/analysis_server/lib/src/socket_server.dart

Issue 2107793002: Generalize DartSdkManager to support embedder SDKs (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
22 * http-based and stdio-based analysis servers. The primary responsibility of 22 * http-based and stdio-based analysis servers. The primary responsibility of
23 * the SocketServer is to manage the lifetime of the AnalysisServer and to 23 * the SocketServer is to manage the lifetime of the AnalysisServer and to
24 * encode and decode the JSON messages exchanged with the client. 24 * encode and decode the JSON messages exchanged with the client.
25 */ 25 */
26 class SocketServer { 26 class SocketServer {
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 DartSdkManager sdkManager;
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 fileResolverProvider;
38 final ResolverProvider packageResolverProvider; 38 final ResolverProvider packageResolverProvider;
39 final bool useSingleContextManager; 39 final bool useSingleContextManager;
40 40
41 /** 41 /**
42 * The analysis server that was created when a client established a 42 * The analysis server that was created when a client established a
43 * connection, or `null` if no such connection has yet been established. 43 * connection, or `null` if no such connection has yet been established.
44 */ 44 */
45 AnalysisServer analysisServer; 45 AnalysisServer analysisServer;
46 46
47 /** 47 /**
48 * The plugins that are defined outside the analysis_server package. 48 * The plugins that are defined outside the analysis_server package.
49 */ 49 */
50 List<Plugin> userDefinedPlugins; 50 List<Plugin> userDefinedPlugins;
51 51
52 SocketServer( 52 SocketServer(
53 this.analysisServerOptions, 53 this.analysisServerOptions,
54 this.defaultSdkCreator, 54 this.sdkManager,
55 this.defaultSdk, 55 this.defaultSdk,
56 this.instrumentationService, 56 this.instrumentationService,
57 this.serverPlugin, 57 this.serverPlugin,
58 this.fileResolverProvider, 58 this.fileResolverProvider,
59 this.packageResolverProvider, 59 this.packageResolverProvider,
60 this.useSingleContextManager); 60 this.useSingleContextManager);
61 61
62 /** 62 /**
63 * 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
64 * given serverChannel. 64 * given serverChannel.
(...skipping 25 matching lines...) Expand all
90 index = createMemoryIndex(); 90 index = createMemoryIndex();
91 } 91 }
92 92
93 analysisServer = new AnalysisServer( 93 analysisServer = new AnalysisServer(
94 serverChannel, 94 serverChannel,
95 resourceProvider, 95 resourceProvider,
96 new PubPackageMapProvider(resourceProvider, defaultSdk), 96 new PubPackageMapProvider(resourceProvider, defaultSdk),
97 index, 97 index,
98 serverPlugin, 98 serverPlugin,
99 analysisServerOptions, 99 analysisServerOptions,
100 defaultSdkCreator, 100 sdkManager,
101 instrumentationService, 101 instrumentationService,
102 fileResolverProvider: fileResolverProvider, 102 fileResolverProvider: fileResolverProvider,
103 packageResolverProvider: packageResolverProvider, 103 packageResolverProvider: packageResolverProvider,
104 useSingleContextManager: useSingleContextManager, 104 useSingleContextManager: useSingleContextManager,
105 rethrowExceptions: false); 105 rethrowExceptions: false);
106 analysisServer.userDefinedPlugins = userDefinedPlugins; 106 analysisServer.userDefinedPlugins = userDefinedPlugins;
107 } 107 }
108 } 108 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/server/driver.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698