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

Unified Diff: pkg/analysis_server/lib/src/server/driver.dart

Issue 857283003: Addition of the new flag "file-read-mode" into the analysis server to fix the offset bug with Intel… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698