| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 * console instead of being intercepted. | 270 * console instead of being intercepted. |
| 271 */ | 271 */ |
| 272 static const String INTERNAL_PRINT_TO_CONSOLE = "internal-print-to-console"; | 272 static const String INTERNAL_PRINT_TO_CONSOLE = "internal-print-to-console"; |
| 273 | 273 |
| 274 /** | 274 /** |
| 275 * The name of the option used to describe the new analysis driver logger. | 275 * The name of the option used to describe the new analysis driver logger. |
| 276 */ | 276 */ |
| 277 static const String NEW_ANALYSIS_DRIVER_LOG = 'new-analysis-driver-log'; | 277 static const String NEW_ANALYSIS_DRIVER_LOG = 'new-analysis-driver-log'; |
| 278 | 278 |
| 279 /** | 279 /** |
| 280 * The name of the flag used to disable error notifications. | |
| 281 */ | |
| 282 static const String NO_ERROR_NOTIFICATION = "no-error-notification"; | |
| 283 | |
| 284 /** | |
| 285 * The name of the flag used to disable the index. | 280 * The name of the flag used to disable the index. |
| 286 */ | 281 */ |
| 287 static const String NO_INDEX = "no-index"; | 282 static const String NO_INDEX = "no-index"; |
| 288 | 283 |
| 289 /** | 284 /** |
| 290 * The name of the flag used to enable version 2 of semantic highlight | 285 * The name of the flag used to enable version 2 of semantic highlight |
| 291 * notification. | 286 * notification. |
| 292 */ | 287 */ |
| 293 static const String USE_ANALISYS_HIGHLIGHT2 = "useAnalysisHighlight2"; | 288 static const String USE_ANALISYS_HIGHLIGHT2 = "useAnalysisHighlight2"; |
| 294 | 289 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.finerGrainedInvalidation = | 389 analysisServerOptions.finerGrainedInvalidation = |
| 395 results[FINER_GRAINED_INVALIDATION]; | 390 results[FINER_GRAINED_INVALIDATION]; |
| 396 analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION]; | |
| 397 analysisServerOptions.noIndex = results[NO_INDEX]; | 391 analysisServerOptions.noIndex = results[NO_INDEX]; |
| 398 analysisServerOptions.useAnalysisHighlight2 = | 392 analysisServerOptions.useAnalysisHighlight2 = |
| 399 results[USE_ANALISYS_HIGHLIGHT2]; | 393 results[USE_ANALISYS_HIGHLIGHT2]; |
| 400 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; | 394 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; |
| 401 analysisServerOptions.newAnalysisDriverLog = | 395 analysisServerOptions.newAnalysisDriverLog = |
| 402 results[NEW_ANALYSIS_DRIVER_LOG]; | 396 results[NEW_ANALYSIS_DRIVER_LOG]; |
| 403 | 397 |
| 404 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); | 398 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); |
| 405 | 399 |
| 406 // | 400 // |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 help: "enable sending `print` output to the console", | 556 help: "enable sending `print` output to the console", |
| 563 defaultsTo: false, | 557 defaultsTo: false, |
| 564 negatable: false); | 558 negatable: false); |
| 565 parser.addOption(NEW_ANALYSIS_DRIVER_LOG, | 559 parser.addOption(NEW_ANALYSIS_DRIVER_LOG, |
| 566 help: "set a destination for the new analysis driver's log"); | 560 help: "set a destination for the new analysis driver's log"); |
| 567 parser.addOption(PORT_OPTION, | 561 parser.addOption(PORT_OPTION, |
| 568 help: "the http diagnostic port on which the server provides" | 562 help: "the http diagnostic port on which the server provides" |
| 569 " status and performance information"); | 563 " status and performance information"); |
| 570 parser.addOption(INTERNAL_DELAY_FREQUENCY); | 564 parser.addOption(INTERNAL_DELAY_FREQUENCY); |
| 571 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); | 565 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); |
| 572 parser.addFlag(NO_ERROR_NOTIFICATION, | |
| 573 help: "disable sending all analysis error notifications to the server", | |
| 574 defaultsTo: false, | |
| 575 negatable: false); | |
| 576 parser.addFlag(NO_INDEX, | 566 parser.addFlag(NO_INDEX, |
| 577 help: "disable indexing sources", defaultsTo: false, negatable: false); | 567 help: "disable indexing sources", defaultsTo: false, negatable: false); |
| 578 parser.addFlag(USE_ANALISYS_HIGHLIGHT2, | 568 parser.addFlag(USE_ANALISYS_HIGHLIGHT2, |
| 579 help: "enable version 2 of semantic highlight", | 569 help: "enable version 2 of semantic highlight", |
| 580 defaultsTo: false, | 570 defaultsTo: false, |
| 581 negatable: false); | 571 negatable: false); |
| 582 parser.addOption(FILE_READ_MODE, | 572 parser.addOption(FILE_READ_MODE, |
| 583 help: "an option of the ways files can be read from disk, " + | 573 help: "an option of the ways files can be read from disk, " + |
| 584 "some clients normalize end of line characters which would make " + | 574 "some clients normalize end of line characters which would make " + |
| 585 "the file offset and range information incorrect.", | 575 "the file offset and range information incorrect.", |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 660 |
| 671 _DiagnosticServerImpl(); | 661 _DiagnosticServerImpl(); |
| 672 | 662 |
| 673 Future startOnPort(int port) { | 663 Future startOnPort(int port) { |
| 674 return httpServer.serveHttp(port); | 664 return httpServer.serveHttp(port); |
| 675 } | 665 } |
| 676 | 666 |
| 677 @override | 667 @override |
| 678 Future<int> getServerPort() => httpServer.serveHttp(); | 668 Future<int> getServerPort() => httpServer.serveHttp(); |
| 679 } | 669 } |
| OLD | NEW |