perf(dart/transform) Restructure transform to independent phases
Update summary: - Removes the need for resolution, gaining transform speed at the cost of some precision and ability to detect errors - Generates type registrations in the package alongside their declarations - Ensures that line numbers do not change in transformed user code
This commit is contained in:
22
modules/angular2/src/transform/common/formatter.dart
Normal file
22
modules/angular2/src/transform/common/formatter.dart
Normal file
@ -0,0 +1,22 @@
|
||||
library angular2.src.transform.common.formatter;
|
||||
|
||||
import 'package:dart_style/dart_style.dart';
|
||||
|
||||
import 'logging.dart';
|
||||
|
||||
DartFormatter _formatter;
|
||||
|
||||
void init(DartFormatter formatter) {
|
||||
if (_formatter != null) {
|
||||
logger.warning('Formatter is being overwritten.');
|
||||
}
|
||||
_formatter = formatter;
|
||||
}
|
||||
|
||||
DartFormatter get formatter {
|
||||
if (_formatter == null) {
|
||||
logger.info('Formatter never initialized, using default formatter.');
|
||||
_formatter = new DartFormatter();
|
||||
}
|
||||
return _formatter;
|
||||
}
|
Reference in New Issue
Block a user