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

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

Issue 3001413002: Remove uses of the old plugin model from the analysis server (Closed)
Patch Set: Created 3 years, 4 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/plugin/server_plugin.dart';
11 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi n.dart';
12 import 'package:analysis_server/src/server/diagnostic_server.dart'; 10 import 'package:analysis_server/src/server/diagnostic_server.dart';
13 import 'package:analysis_server/src/server/http_server.dart'; 11 import 'package:analysis_server/src/server/http_server.dart';
14 import 'package:analysis_server/src/server/stdio_server.dart'; 12 import 'package:analysis_server/src/server/stdio_server.dart';
15 import 'package:analysis_server/src/socket_server.dart'; 13 import 'package:analysis_server/src/socket_server.dart';
16 import 'package:analysis_server/starter.dart'; 14 import 'package:analysis_server/starter.dart';
17 import 'package:analyzer/file_system/physical_file_system.dart'; 15 import 'package:analyzer/file_system/physical_file_system.dart';
18 import 'package:analyzer/instrumentation/file_instrumentation.dart'; 16 import 'package:analyzer/instrumentation/file_instrumentation.dart';
19 import 'package:analyzer/instrumentation/instrumentation.dart'; 17 import 'package:analyzer/instrumentation/instrumentation.dart';
20 import 'package:analyzer/plugin/resolver_provider.dart'; 18 import 'package:analyzer/plugin/resolver_provider.dart';
21 import 'package:analyzer/src/context/builder.dart'; 19 import 'package:analyzer/src/context/builder.dart';
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 print(''); 348 print('');
351 _printUsage(parser.parser, analytics); 349 _printUsage(parser.parser, analytics);
352 exitCode = 1; 350 exitCode = 1;
353 return null; 351 return null;
354 } 352 }
355 } 353 }
356 354
357 // 355 //
358 // Process all of the plugins so that extensions are registered. 356 // Process all of the plugins so that extensions are registered.
359 // 357 //
360 ServerPlugin serverPlugin = new ServerPlugin();
361 List<Plugin> plugins = <Plugin>[]; 358 List<Plugin> plugins = <Plugin>[];
362 plugins.addAll(AnalysisEngine.instance.requiredPlugins); 359 plugins.addAll(AnalysisEngine.instance.requiredPlugins);
363 plugins.add(serverPlugin);
364 plugins.add(dartCompletionPlugin);
365 plugins.addAll(_userDefinedPlugins); 360 plugins.addAll(_userDefinedPlugins);
366 ExtensionManager manager = new ExtensionManager(); 361 ExtensionManager manager = new ExtensionManager();
367 manager.processPlugins(plugins); 362 manager.processPlugins(plugins);
368 linter.registerLintRules(); 363 linter.registerLintRules();
369 364
370 String defaultSdkPath; 365 String defaultSdkPath;
371 if (results[SDK_OPTION] != null) { 366 if (results[SDK_OPTION] != null) {
372 defaultSdkPath = results[SDK_OPTION]; 367 defaultSdkPath = results[SDK_OPTION];
373 } else { 368 } else {
374 // No path to the SDK was provided. 369 // No path to the SDK was provided.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 406
412 // 407 //
413 // Create the sockets and start listening for requests. 408 // Create the sockets and start listening for requests.
414 // 409 //
415 socketServer = new SocketServer( 410 socketServer = new SocketServer(
416 analysisServerOptions, 411 analysisServerOptions,
417 new DartSdkManager(defaultSdkPath, true), 412 new DartSdkManager(defaultSdkPath, true),
418 defaultSdk, 413 defaultSdk,
419 instrumentationService, 414 instrumentationService,
420 diagnosticServer, 415 diagnosticServer,
421 serverPlugin,
422 fileResolverProvider, 416 fileResolverProvider,
423 packageResolverProvider); 417 packageResolverProvider);
424 httpServer = new HttpAnalysisServer(socketServer); 418 httpServer = new HttpAnalysisServer(socketServer);
425 stdioServer = new StdioAnalysisServer(socketServer); 419 stdioServer = new StdioAnalysisServer(socketServer);
426 socketServer.userDefinedPlugins = _userDefinedPlugins; 420 socketServer.userDefinedPlugins = _userDefinedPlugins;
427 421
428 diagnosticServer.httpServer = httpServer; 422 diagnosticServer.httpServer = httpServer;
429 if (serve_http) { 423 if (serve_http) {
430 diagnosticServer.startOnPort(port); 424 diagnosticServer.startOnPort(port);
431 } 425 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 610
617 _DiagnosticServerImpl(); 611 _DiagnosticServerImpl();
618 612
619 @override 613 @override
620 Future<int> getServerPort() => httpServer.serveHttp(); 614 Future<int> getServerPort() => httpServer.serveHttp();
621 615
622 Future startOnPort(int port) { 616 Future startOnPort(int port) {
623 return httpServer.serveHttp(port); 617 return httpServer.serveHttp(port);
624 } 618 }
625 } 619 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698