| Index: pkg/analysis_server/lib/src/server/driver.dart
|
| diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
|
| index 502b5d6d040f677f376050dc8bdb670d3788b238..dbe06739c301e9675a4c1cb15282e1274eb3d02c 100644
|
| --- a/pkg/analysis_server/lib/src/server/driver.dart
|
| +++ b/pkg/analysis_server/lib/src/server/driver.dart
|
| @@ -115,11 +115,16 @@ class Driver implements ServerStarter {
|
| static const String SDK_OPTION = "sdk";
|
|
|
| /**
|
| - * The name of the option used to disable error notifications.
|
| + * The name of the flag used to disable error notifications.
|
| */
|
| static const String NO_ERROR_NOTIFICATION = "no-error-notification";
|
|
|
| /**
|
| + * The name of the option used to set the file read mode.
|
| + */
|
| + static const String FILE_READ_MODE = "file-read-mode";
|
| +
|
| + /**
|
| * The instrumentation server that is to be used by the analysis server.
|
| */
|
| InstrumentationServer instrumentationServer;
|
| @@ -194,6 +199,7 @@ class Driver implements ServerStarter {
|
| analysisServerOptions.enableIncrementalResolutionValidation =
|
| results[INCREMENTAL_RESOLUTION_VALIDATION];
|
| analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION];
|
| + analysisServerOptions.fileReadMode = results[FILE_READ_MODE];
|
|
|
| _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]);
|
|
|
| @@ -312,10 +318,20 @@ class Driver implements ServerStarter {
|
| parser.addOption(SDK_OPTION, help: "[path] the path to the sdk");
|
| parser.addFlag(
|
| NO_ERROR_NOTIFICATION,
|
| - help:
|
| - "disable sending all analysis error notifications to the server",
|
| + help: "disable sending all analysis error notifications to the server",
|
| defaultsTo: false,
|
| negatable: false);
|
| + parser.addOption(
|
| + FILE_READ_MODE,
|
| + help: "an option of the ways files can be read from disk, " +
|
| + "some clients normalize end of line characters which would make " +
|
| + "the file offset and range information incorrect.",
|
| + allowed: ["as-is", "normalize-eol"],
|
| + allowedHelp: {
|
| + "as-is": "file contents are read as-is, no file changes occur",
|
| + "normalize-eol":
|
| + "file contents normalize the end of line characters to the single character new line `\n`"
|
| + }, defaultsTo: "as-is");
|
|
|
| return parser;
|
| }
|
|
|