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 08cb05f9cc13d440889e55e054a2d7ea33a1163e..c09c6c925251c0f38c2b34bf86f6663397b556c3 100644 |
--- a/pkg/analysis_server/lib/src/server/driver.dart |
+++ b/pkg/analysis_server/lib/src/server/driver.dart |
@@ -52,7 +52,6 @@ void _initIncrementalLogger(String spec) { |
} |
} |
- |
/** |
* The [Driver] class represents a single running instance of the analysis |
* server application. It is responsible for parsing command line options |
@@ -255,12 +254,8 @@ class Driver implements ServerStarter { |
} |
InstrumentationService service = |
new InstrumentationService(instrumentationServer); |
- service.logVersion( |
- _readUuid(service), |
- results[CLIENT_ID], |
- results[CLIENT_VERSION], |
- AnalysisServer.VERSION, |
- defaultSdk.sdkVersion); |
+ service.logVersion(_readUuid(service), results[CLIENT_ID], |
+ results[CLIENT_VERSION], AnalysisServer.VERSION, defaultSdk.sdkVersion); |
AnalysisEngine.instance.instrumentationService = service; |
// |
// Process all of the plugins so that extensions are registered. |
@@ -272,8 +267,8 @@ class Driver implements ServerStarter { |
ExtensionManager manager = new ExtensionManager(); |
manager.processPlugins(plugins); |
- socketServer = |
- new SocketServer(analysisServerOptions, defaultSdk, service, serverPlugin); |
+ socketServer = new SocketServer( |
+ analysisServerOptions, defaultSdk, service, serverPlugin); |
httpServer = new HttpAnalysisServer(socketServer); |
stdioServer = new StdioAnalysisServer(socketServer); |
@@ -290,7 +285,9 @@ class Driver implements ServerStarter { |
exit(0); |
}); |
}, |
- print: results[INTERNAL_PRINT_TO_CONSOLE] ? null : httpServer.recordPrint); |
+ print: results[INTERNAL_PRINT_TO_CONSOLE] |
+ ? null |
+ : httpServer.recordPrint); |
} |
/** |
@@ -301,24 +298,22 @@ class Driver implements ServerStarter { |
*/ |
dynamic _captureExceptions(InstrumentationService service, dynamic callback(), |
{void print(String line)}) { |
- Function errorFunction = |
- (Zone self, ZoneDelegate parent, Zone zone, dynamic exception, |
- StackTrace stackTrace) { |
+ Function errorFunction = (Zone self, ZoneDelegate parent, Zone zone, |
+ dynamic exception, StackTrace stackTrace) { |
service.logPriorityException(exception, stackTrace); |
AnalysisServer analysisServer = socketServer.analysisServer; |
analysisServer.sendServerErrorNotification(exception, stackTrace); |
throw exception; |
}; |
- Function printFunction = print == null ? |
- null : |
- (Zone self, ZoneDelegate parent, Zone zone, String line) { |
+ Function printFunction = print == null |
+ ? null |
+ : (Zone self, ZoneDelegate parent, Zone zone, String line) { |
// Note: we don't pass the line on to stdout, because that is reserved |
// for communication to the client. |
print(line); |
}; |
ZoneSpecification zoneSpecification = new ZoneSpecification( |
- handleUncaughtError: errorFunction, |
- print: printFunction); |
+ handleUncaughtError: errorFunction, print: printFunction); |
return runZoned(callback, zoneSpecification: zoneSpecification); |
} |
@@ -328,59 +323,45 @@ class Driver implements ServerStarter { |
CommandLineParser _createArgParser() { |
CommandLineParser parser = |
new CommandLineParser(alwaysIgnoreUnrecognized: true); |
- parser.addOption( |
- CLIENT_ID, |
+ parser.addOption(CLIENT_ID, |
help: "an identifier used to identify the client"); |
parser.addOption(CLIENT_VERSION, help: "the version of the client"); |
- parser.addFlag( |
- ENABLE_INCREMENTAL_RESOLUTION_API, |
+ parser.addFlag(ENABLE_INCREMENTAL_RESOLUTION_API, |
help: "enable using incremental resolution for API changes", |
defaultsTo: false, |
negatable: false); |
- parser.addFlag( |
- ENABLE_INSTRUMENTATION_OPTION, |
+ parser.addFlag(ENABLE_INSTRUMENTATION_OPTION, |
help: "enable sending instrumentation information to a server", |
defaultsTo: false, |
negatable: false); |
- parser.addFlag( |
- HELP_OPTION, |
+ parser.addFlag(HELP_OPTION, |
help: "print this help message without starting a server", |
defaultsTo: false, |
negatable: false); |
- parser.addOption( |
- INCREMENTAL_RESOLUTION_LOG, |
+ parser.addOption(INCREMENTAL_RESOLUTION_LOG, |
help: "the description of the incremental resolution log"); |
- parser.addFlag( |
- INCREMENTAL_RESOLUTION_VALIDATION, |
+ parser.addFlag(INCREMENTAL_RESOLUTION_VALIDATION, |
help: "enable validation of incremental resolution results (slow)", |
defaultsTo: false, |
negatable: false); |
- parser.addOption( |
- INSTRUMENTATION_LOG_FILE, |
+ parser.addOption(INSTRUMENTATION_LOG_FILE, |
help: "the path of the file to which instrumentation data will be written"); |
- parser.addFlag( |
- INTERNAL_PRINT_TO_CONSOLE, |
+ parser.addFlag(INTERNAL_PRINT_TO_CONSOLE, |
help: "enable sending `print` output to the console", |
defaultsTo: false, |
negatable: false); |
- parser.addOption( |
- PORT_OPTION, |
+ parser.addOption(PORT_OPTION, |
help: "the http diagnostic port on which the server provides" |
- " status and performance information"); |
+ " status and performance information"); |
parser.addOption(INTERNAL_DELAY_FREQUENCY); |
parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); |
- parser.addFlag( |
- NO_ERROR_NOTIFICATION, |
+ parser.addFlag(NO_ERROR_NOTIFICATION, |
help: "disable sending all analysis error notifications to the server", |
defaultsTo: false, |
negatable: false); |
- parser.addFlag( |
- NO_INDEX, |
- help: "disable indexing sources", |
- defaultsTo: false, |
- negatable: false); |
- parser.addOption( |
- FILE_READ_MODE, |
+ parser.addFlag(NO_INDEX, |
+ help: "disable indexing sources", 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.", |
@@ -389,7 +370,8 @@ class Driver implements ServerStarter { |
"as-is": "file contents are read as-is, no file changes occur", |
"normalize-eol-always": |
r'file contents normalize the end of line characters to the single character new line `\n`' |
- }, defaultsTo: "as-is"); |
+ }, |
+ defaultsTo: "as-is"); |
return parser; |
} |
@@ -408,9 +390,9 @@ class Driver implements ServerStarter { |
* Read the UUID from disk, generating and storing a new one if necessary. |
*/ |
String _readUuid(InstrumentationService service) { |
- File uuidFile = new File( |
- PhysicalResourceProvider.INSTANCE.getStateLocation( |
- '.instrumentation').getChild('uuid.txt').path); |
+ File uuidFile = new File(PhysicalResourceProvider.INSTANCE |
+ .getStateLocation('.instrumentation') |
+ .getChild('uuid.txt').path); |
try { |
if (uuidFile.existsSync()) { |
String uuid = uuidFile.readAsStringSync(); |