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 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 |
11 import 'package:analysis_server/src/analysis_server.dart'; | 11 import 'package:analysis_server/src/analysis_server.dart'; |
12 import 'package:analysis_server/src/plugin/linter_plugin.dart'; | 12 import 'package:analysis_server/src/plugin/linter_plugin.dart'; |
13 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 13 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
14 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; | 14 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
15 import 'package:analysis_server/src/server/http_server.dart'; | 15 import 'package:analysis_server/src/server/http_server.dart'; |
16 import 'package:analysis_server/src/server/stdio_server.dart'; | 16 import 'package:analysis_server/src/server/stdio_server.dart'; |
17 import 'package:analysis_server/src/socket_server.dart'; | 17 import 'package:analysis_server/src/socket_server.dart'; |
18 import 'package:analysis_server/starter.dart'; | 18 import 'package:analysis_server/starter.dart'; |
19 import 'package:analyzer/file_system/physical_file_system.dart'; | 19 import 'package:analyzer/file_system/physical_file_system.dart'; |
20 import 'package:analyzer/instrumentation/file_instrumentation.dart'; | 20 import 'package:analyzer/instrumentation/file_instrumentation.dart'; |
21 import 'package:analyzer/instrumentation/instrumentation.dart'; | 21 import 'package:analyzer/instrumentation/instrumentation.dart'; |
22 import 'package:analyzer/plugin/embedded_resolver_provider.dart'; | |
23 import 'package:analyzer/plugin/resolver_provider.dart'; | 22 import 'package:analyzer/plugin/resolver_provider.dart'; |
24 import 'package:analyzer/src/generated/engine.dart'; | 23 import 'package:analyzer/src/generated/engine.dart'; |
25 import 'package:analyzer/src/generated/incremental_logger.dart'; | 24 import 'package:analyzer/src/generated/incremental_logger.dart'; |
26 import 'package:analyzer/src/generated/java_io.dart'; | 25 import 'package:analyzer/src/generated/java_io.dart'; |
27 import 'package:analyzer/src/generated/sdk.dart'; | 26 import 'package:analyzer/src/generated/sdk.dart'; |
28 import 'package:analyzer/src/generated/sdk_io.dart'; | 27 import 'package:analyzer/src/generated/sdk_io.dart'; |
29 import 'package:args/args.dart'; | 28 import 'package:args/args.dart'; |
30 import 'package:linter/src/plugin/linter_plugin.dart'; | 29 import 'package:linter/src/plugin/linter_plugin.dart'; |
31 import 'package:plugin/manager.dart'; | 30 import 'package:plugin/manager.dart'; |
32 import 'package:plugin/plugin.dart'; | 31 import 'package:plugin/plugin.dart'; |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 * operational. | 290 * operational. |
292 */ | 291 */ |
293 static const String SDK_OPTION = "sdk"; | 292 static const String SDK_OPTION = "sdk"; |
294 | 293 |
295 /** | 294 /** |
296 * The instrumentation server that is to be used by the analysis server. | 295 * The instrumentation server that is to be used by the analysis server. |
297 */ | 296 */ |
298 InstrumentationServer instrumentationServer; | 297 InstrumentationServer instrumentationServer; |
299 | 298 |
300 /** | 299 /** |
301 * The embedded library URI resolver provider used to override the way | |
302 * embedded library URI's are resolved in some contexts. | |
303 */ | |
304 EmbeddedResolverProvider embeddedUriResolverProvider; | |
305 | |
306 /** | |
307 * The package resolver provider used to override the way package URI's are | 300 * The package resolver provider used to override the way package URI's are |
308 * resolved in some contexts. | 301 * resolved in some contexts. |
309 */ | 302 */ |
310 ResolverProvider packageResolverProvider; | 303 ResolverProvider packageResolverProvider; |
311 | 304 |
312 /** | 305 /** |
313 * If this flag is `true`, then single analysis context should be used for | 306 * If this flag is `true`, then single analysis context should be used for |
314 * analysis of multiple analysis roots, special files that could otherwise | 307 * analysis of multiple analysis roots, special files that could otherwise |
315 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`, | 308 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`, |
316 * or analysis options are ignored. | 309 * or analysis options are ignored. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 AnalysisEngine.instance.instrumentationService = service; | 432 AnalysisEngine.instance.instrumentationService = service; |
440 // | 433 // |
441 // Create the sockets and start listening for requests. | 434 // Create the sockets and start listening for requests. |
442 // | 435 // |
443 socketServer = new SocketServer( | 436 socketServer = new SocketServer( |
444 analysisServerOptions, | 437 analysisServerOptions, |
445 defaultSdkCreator, | 438 defaultSdkCreator, |
446 defaultSdk, | 439 defaultSdk, |
447 service, | 440 service, |
448 serverPlugin, | 441 serverPlugin, |
449 embeddedUriResolverProvider, | |
450 packageResolverProvider, | 442 packageResolverProvider, |
451 useSingleContextManager); | 443 useSingleContextManager); |
452 httpServer = new HttpAnalysisServer(socketServer); | 444 httpServer = new HttpAnalysisServer(socketServer); |
453 stdioServer = new StdioAnalysisServer(socketServer); | 445 stdioServer = new StdioAnalysisServer(socketServer); |
454 socketServer.userDefinedPlugins = _userDefinedPlugins; | 446 socketServer.userDefinedPlugins = _userDefinedPlugins; |
455 | 447 |
456 if (serve_http) { | 448 if (serve_http) { |
457 httpServer.serveHttp(port); | 449 httpServer.serveHttp(port); |
458 } | 450 } |
459 | 451 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 */ | 605 */ |
614 static void _rollLogFiles(String path, int numOld) { | 606 static void _rollLogFiles(String path, int numOld) { |
615 for (int i = numOld - 1; i >= 0; i--) { | 607 for (int i = numOld - 1; i >= 0; i--) { |
616 try { | 608 try { |
617 String oldPath = i == 0 ? path : '$path.$i'; | 609 String oldPath = i == 0 ? path : '$path.$i'; |
618 new File(oldPath).renameSync('$path.${i+1}'); | 610 new File(oldPath).renameSync('$path.${i+1}'); |
619 } catch (e) {} | 611 } catch (e) {} |
620 } | 612 } |
621 } | 613 } |
622 } | 614 } |
OLD | NEW |