anchor.diff:                  options: option)
               .then((RefactoringResult result) {
             if (result == null) return;
  -          _handleRefactoringResult(result, oldName, newName, path);
  +          _handleRefactoringResult(result, "Renamed '${oldName}' to '${newName}'.", path);
           });
         });
         job.schedule();
  
positive.code:     }).then((_) {
        String fileSummary = sourceFileEdits.map((edit) => edit.file).join('\n');
        if (sourceFileEdits.length == 1) fileSummary = null;
        atom.notifications.addSuccess("Renamed '${oldName}' to '${newName}'.",
            detail: fileSummary);
      }).catchError((e) {
        atom.notifications.addError('Error Performing Rename', detail: '${e}');
      });
    }
  
    static String _findIdentifier(String text, int offset) {
      while (offset > 0) {
        if (idRegex.hasMatch(text[offset - 1])) {
  
negative.code:   }
  
    void _handleRefactoringResult(
        RefactoringResult result, String successMsg, String path) {
      // TODO: use optionsProblems
      // TODO: use finalProblems
      // TODO: use feedback
      if (result.initialProblems.isNotEmpty) {
        atom.notifications.addError('Unable to Refactor',
            detail: '${result.initialProblems.first.message}');
        atom.beep();
        return;
      }
  
      SourceChange change = result.change;
      if (change == null) {
        atom.notifications.addError('Unable to Refactor',
            detail: 'No change information returned.');
        atom.beep();
        return;
      }
  
      // Remove any 'potential' edits. The analysis server sends over things
      // like edits to package: files.
      List<SourceFileEdit> sourceFileEdits = change.edits;
      sourceFileEdits.forEach((SourceFileEdit fileEdit) {
        fileEdit.edits.removeWhere((SourceEdit edit) => edit.id != null);
      });
      sourceFileEdits
          .removeWhere((SourceFileEdit fileEdit) => fileEdit.edits.isEmpty);
  
      var apply = () {
        _applyEdits(sourceFileEdits, successMsg)
            .then((_) {
          // Ensure the original file is selected.
          atom.workspace.open(path);
        });
      };
  
      // If this changes a single file,
      // then apply the change without confirming with the user
      if (sourceFileEdits.length == 1) {
        apply();
        return;
      }
  
      // Otherwise, confirm this refactoring with users
      // since it will affect multiple files.
      var project = projectManager.getProjectFor(path);
      String projectPrefix = project == null ? '' : project.path;
  
      Iterable<String> paths = sourceFileEdits.map((edit) {
        String filePath = edit.file;
        if (filePath.startsWith(projectPrefix)) {
          return project.name + filePath.substring(projectPrefix.length);
        } else {
          return filePath;
        }
      });
      String fileSummary = (paths.toList()..sort()).join('\n');
      Notification notification;
  
      var userConfirmed = () {
        notification.dismiss();
        apply();
      };
  
      var userCancelled = () => notification.dismiss();
  
      notification = atom.notifications
          .addInfo('Refactor ${sourceFileEdits.length} files?',
              detail: fileSummary,
              dismissable: true,
              buttons: [
                new NotificationButton('Continue', userConfirmed),
                new NotificationButton('Cancel', userCancelled)
              ]);
    }
  
    /// Apply the source edits, displaying [successMsg] once complete.
    Future _applyEdits(List<SourceFileEdit> sourceFileEdits, String successMsg) {
      return Future.forEach(sourceFileEdits, (SourceFileEdit edit) {
        return atom.workspace.open(edit.file, options: {'searchAllPanes': true})
            .then((TextEditor editor) {
  