| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 | 2 |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
| 11 import 'package:path/path.dart' as path; | 11 import 'package:path/path.dart' as path; |
| 12 | 12 |
| 13 import 'package:analyzer_experimental/src/services/formatter_impl.dart'; | 13 import 'package:analyzer/src/services/formatter_impl.dart'; |
| 14 | 14 |
| 15 | 15 |
| 16 const BINARY_NAME = 'dartfmt'; | 16 const BINARY_NAME = 'dartfmt'; |
| 17 final dartFileRegExp = new RegExp(r'^[^.].*\.dart$', caseSensitive: false); | 17 final dartFileRegExp = new RegExp(r'^[^.].*\.dart$', caseSensitive: false); |
| 18 final argParser = _initArgParser(); | 18 final argParser = _initArgParser(); |
| 19 final defaultSelection = new Selection(-1, -1); | 19 final defaultSelection = new Selection(-1, -1); |
| 20 | 20 |
| 21 var formatterSettings; | 21 var formatterSettings; |
| 22 | 22 |
| 23 bool machineFormat; | 23 bool machineFormat; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 'offset': formatResult.selection.offset, | 173 'offset': formatResult.selection.offset, |
| 174 'length': formatResult.selection.length | 174 'length': formatResult.selection.length |
| 175 } | 175 } |
| 176 }); | 176 }); |
| 177 | 177 |
| 178 /// Log the given [msg]. | 178 /// Log the given [msg]. |
| 179 _log(String msg) { | 179 _log(String msg) { |
| 180 //TODO(pquitslund): add proper log support | 180 //TODO(pquitslund): add proper log support |
| 181 print(msg); | 181 print(msg); |
| 182 } | 182 } |
| OLD | NEW |