| Index: pkg/analyzer_experimental/bin/formatter.dart
|
| ===================================================================
|
| --- pkg/analyzer_experimental/bin/formatter.dart (revision 28369)
|
| +++ pkg/analyzer_experimental/bin/formatter.dart (working copy)
|
| @@ -19,11 +19,14 @@
|
| final argParser = _initArgParser();
|
| final defaultSelection = new Selection(-1, -1);
|
|
|
| +var formatterSettings;
|
| +
|
| bool machineFormat;
|
| bool overwriteFileContents;
|
| Selection selection;
|
| const followLinks = false;
|
|
|
| +
|
| main() {
|
| var options = argParser.parse(new Options().arguments);
|
| if (options['help']) {
|
| @@ -44,6 +47,8 @@
|
| machineFormat = options['machine'];
|
| overwriteFileContents = options['write'];
|
| selection = _parseSelection(options['selection']);
|
| + formatterSettings =
|
| + new FormatterOptions(codeTransforms: options['transform']);
|
| }
|
|
|
| Selection _parseSelection(selectionOption) {
|
| @@ -150,8 +155,8 @@
|
| }
|
|
|
| /// Format the given [src] as a compilation unit.
|
| -String _formatCU(src, {options: const FormatterOptions()}) {
|
| - var formatResult = new CodeFormatter(options).format(
|
| +String _formatCU(src) {
|
| + var formatResult = new CodeFormatter(formatterSettings).format(
|
| CodeKind.COMPILATION_UNIT, src, selection: selection);
|
| if (machineFormat) {
|
| if (formatResult.selection == null) {
|
|
|