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

Side by Side Diff: pkg/analysis_server/lib/src/server/driver.dart

Issue 1915833007: Add Driver.useSingleContextManager to turn on single context manager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 driver; 5 library driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:math'; 9 import 'dart:math';
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 */ 303 */
304 EmbeddedResolverProvider embeddedUriResolverProvider; 304 EmbeddedResolverProvider embeddedUriResolverProvider;
305 305
306 /** 306 /**
307 * The package resolver provider used to override the way package URI's are 307 * The package resolver provider used to override the way package URI's are
308 * resolved in some contexts. 308 * resolved in some contexts.
309 */ 309 */
310 ResolverProvider packageResolverProvider; 310 ResolverProvider packageResolverProvider;
311 311
312 /** 312 /**
313 * If this flag is `true`, then single analysis context should be used for
314 * analysis of multiple analysis roots, special files that could otherwise
315 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`,
316 * or `.analysis_options` are ignored.
317 */
318 bool useSingleContextManager = false;
319
320 /**
313 * The plugins that are defined outside the analysis_server package. 321 * The plugins that are defined outside the analysis_server package.
314 */ 322 */
315 List<Plugin> _userDefinedPlugins = <Plugin>[]; 323 List<Plugin> _userDefinedPlugins = <Plugin>[];
316 324
317 SocketServer socketServer; 325 SocketServer socketServer;
318 326
319 HttpAnalysisServer httpServer; 327 HttpAnalysisServer httpServer;
320 328
321 StdioAnalysisServer stdioServer; 329 StdioAnalysisServer stdioServer;
322 330
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 AnalysisEngine.instance.instrumentationService = service; 437 AnalysisEngine.instance.instrumentationService = service;
430 // 438 //
431 // Create the sockets and start listening for requests. 439 // Create the sockets and start listening for requests.
432 // 440 //
433 socketServer = new SocketServer( 441 socketServer = new SocketServer(
434 analysisServerOptions, 442 analysisServerOptions,
435 defaultSdkCreator, 443 defaultSdkCreator,
436 defaultSdk, 444 defaultSdk,
437 service, 445 service,
438 serverPlugin, 446 serverPlugin,
447 embeddedUriResolverProvider,
439 packageResolverProvider, 448 packageResolverProvider,
440 embeddedUriResolverProvider); 449 useSingleContextManager);
441 httpServer = new HttpAnalysisServer(socketServer); 450 httpServer = new HttpAnalysisServer(socketServer);
442 stdioServer = new StdioAnalysisServer(socketServer); 451 stdioServer = new StdioAnalysisServer(socketServer);
443 socketServer.userDefinedPlugins = _userDefinedPlugins; 452 socketServer.userDefinedPlugins = _userDefinedPlugins;
444 453
445 if (serve_http) { 454 if (serve_http) {
446 httpServer.serveHttp(port); 455 httpServer.serveHttp(port);
447 } 456 }
448 457
449 _captureExceptions(service, () { 458 _captureExceptions(service, () {
450 stdioServer.serveStdio().then((_) async { 459 stdioServer.serveStdio().then((_) async {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 */ 611 */
603 static void _rollLogFiles(String path, int numOld) { 612 static void _rollLogFiles(String path, int numOld) {
604 for (int i = numOld - 1; i >= 0; i--) { 613 for (int i = numOld - 1; i >= 0; i--) {
605 try { 614 try {
606 String oldPath = i == 0 ? path : '$path.$i'; 615 String oldPath = i == 0 ? path : '$path.$i';
607 new File(oldPath).renameSync('$path.${i+1}'); 616 new File(oldPath).renameSync('$path.${i+1}');
608 } catch (e) {} 617 } catch (e) {}
609 } 618 }
610 } 619 }
611 } 620 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/socket_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698