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 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 */ | 271 */ |
272 static const String NEW_ANALYSIS_DRIVER_LOG = 'new-analysis-driver-log'; | 272 static const String NEW_ANALYSIS_DRIVER_LOG = 'new-analysis-driver-log'; |
273 | 273 |
274 /** | 274 /** |
275 * The name of the option used to enable verbose Flutter completion code gener
ation. | 275 * The name of the option used to enable verbose Flutter completion code gener
ation. |
276 */ | 276 */ |
277 static const String VERBOSE_FLUTTER_COMPLETIONS = | 277 static const String VERBOSE_FLUTTER_COMPLETIONS = |
278 'verbose-flutter-completions'; | 278 'verbose-flutter-completions'; |
279 | 279 |
280 /** | 280 /** |
281 * The name of the flag used to disable the index. | |
282 */ | |
283 static const String NO_INDEX = "no-index"; | |
284 | |
285 /** | |
286 * The name of the flag used to enable version 2 of semantic highlight | 281 * The name of the flag used to enable version 2 of semantic highlight |
287 * notification. | 282 * notification. |
288 */ | 283 */ |
289 static const String USE_ANALYSIS_HIGHLIGHT2 = "useAnalysisHighlight2"; | 284 static const String USE_ANALYSIS_HIGHLIGHT2 = "useAnalysisHighlight2"; |
290 | 285 |
291 /** | 286 /** |
292 * The option for specifying the http diagnostic port. | 287 * The option for specifying the http diagnostic port. |
293 * If specified, users can review server status and performance information | 288 * If specified, users can review server status and performance information |
294 * by opening a web browser on http://localhost:<port> | 289 * by opening a web browser on http://localhost:<port> |
295 */ | 290 */ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 379 } |
385 } | 380 } |
386 | 381 |
387 AnalysisServerOptions analysisServerOptions = new AnalysisServerOptions(); | 382 AnalysisServerOptions analysisServerOptions = new AnalysisServerOptions(); |
388 analysisServerOptions.enableIncrementalResolutionApi = | 383 analysisServerOptions.enableIncrementalResolutionApi = |
389 results[ENABLE_INCREMENTAL_RESOLUTION_API]; | 384 results[ENABLE_INCREMENTAL_RESOLUTION_API]; |
390 analysisServerOptions.enableIncrementalResolutionValidation = | 385 analysisServerOptions.enableIncrementalResolutionValidation = |
391 results[INCREMENTAL_RESOLUTION_VALIDATION]; | 386 results[INCREMENTAL_RESOLUTION_VALIDATION]; |
392 analysisServerOptions.enableNewAnalysisDriver = | 387 analysisServerOptions.enableNewAnalysisDriver = |
393 !results[DISABLE_NEW_ANALYSIS_DRIVER]; | 388 !results[DISABLE_NEW_ANALYSIS_DRIVER]; |
394 analysisServerOptions.noIndex = results[NO_INDEX]; | |
395 analysisServerOptions.useAnalysisHighlight2 = | 389 analysisServerOptions.useAnalysisHighlight2 = |
396 results[USE_ANALYSIS_HIGHLIGHT2]; | 390 results[USE_ANALYSIS_HIGHLIGHT2]; |
397 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; | 391 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; |
398 analysisServerOptions.newAnalysisDriverLog = | 392 analysisServerOptions.newAnalysisDriverLog = |
399 results[NEW_ANALYSIS_DRIVER_LOG]; | 393 results[NEW_ANALYSIS_DRIVER_LOG]; |
400 analysisServerOptions.enableVerboseFlutterCompletions = | 394 analysisServerOptions.enableVerboseFlutterCompletions = |
401 results[VERBOSE_FLUTTER_COMPLETIONS]; | 395 results[VERBOSE_FLUTTER_COMPLETIONS]; |
402 | 396 |
403 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); | 397 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); |
404 | 398 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 negatable: false); | 555 negatable: false); |
562 parser.addOption(NEW_ANALYSIS_DRIVER_LOG, | 556 parser.addOption(NEW_ANALYSIS_DRIVER_LOG, |
563 help: "set a destination for the new analysis driver's log"); | 557 help: "set a destination for the new analysis driver's log"); |
564 parser.addFlag(VERBOSE_FLUTTER_COMPLETIONS, | 558 parser.addFlag(VERBOSE_FLUTTER_COMPLETIONS, |
565 help: "enable verbose code completion for Flutter (experimental)"); | 559 help: "enable verbose code completion for Flutter (experimental)"); |
566 parser.addOption(PORT_OPTION, | 560 parser.addOption(PORT_OPTION, |
567 help: "the http diagnostic port on which the server provides" | 561 help: "the http diagnostic port on which the server provides" |
568 " status and performance information"); | 562 " status and performance information"); |
569 parser.addOption(INTERNAL_DELAY_FREQUENCY); | 563 parser.addOption(INTERNAL_DELAY_FREQUENCY); |
570 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); | 564 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); |
571 parser.addFlag(NO_INDEX, | |
572 help: "disable indexing sources", defaultsTo: false, negatable: false); | |
573 parser.addFlag(USE_ANALYSIS_HIGHLIGHT2, | 565 parser.addFlag(USE_ANALYSIS_HIGHLIGHT2, |
574 help: "enable version 2 of semantic highlight", | 566 help: "enable version 2 of semantic highlight", |
575 defaultsTo: false, | 567 defaultsTo: false, |
576 negatable: false); | 568 negatable: false); |
577 parser.addOption(FILE_READ_MODE, | 569 parser.addOption(FILE_READ_MODE, |
578 help: "an option for reading files (some clients normalize eol " | 570 help: "an option for reading files (some clients normalize eol " |
579 "characters, which make the file offset and range information " | 571 "characters, which make the file offset and range information " |
580 "incorrect)", | 572 "incorrect)", |
581 allowed: ["as-is", "normalize-eol-always"], | 573 allowed: ["as-is", "normalize-eol-always"], |
582 allowedHelp: { | 574 allowedHelp: { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 657 |
666 _DiagnosticServerImpl(); | 658 _DiagnosticServerImpl(); |
667 | 659 |
668 @override | 660 @override |
669 Future<int> getServerPort() => httpServer.serveHttp(); | 661 Future<int> getServerPort() => httpServer.serveHttp(); |
670 | 662 |
671 Future startOnPort(int port) { | 663 Future startOnPort(int port) { |
672 return httpServer.serveHttp(port); | 664 return httpServer.serveHttp(port); |
673 } | 665 } |
674 } | 666 } |
OLD | NEW |