anchor.diff:    _log(buffer.toString());
   }
   
  -/// Format the given [src] as a compilation unit.
  -String _formatCU(src) {
  +/// Format this [src], treating it as the given snippet [kind].
  +String _format(src, kind) {
     var formatResult = new CodeFormatter(formatterSettings).format(
  -      CodeKind.COMPILATION_UNIT, src, selection: selection);
  +      kind, src, selection: selection);
     if (machineFormat) {
       if (formatResult.selection == null) {
         formatResult.selection = defaultSelection;
  
positive.code: 
  var formatterSettings;
  
  bool machineFormat;
  bool overwriteFileContents;
  Selection selection;
  
negative.code:     try {
        var buffer = new StringBuffer();
        var rawSource = file.readAsStringSync();
        var formatted = _format(rawSource, CodeKind.COMPILATION_UNIT);
        if (overwriteFileContents) {
          file.writeAsStringSync(formatted);
        } else {
  