@Override
  public void format(final FormattingModel model,
                     final CodeStyleSettings settings,
                     final CommonCodeStyleSettings.IndentOptions indentOptions,
                     final FormatTextRanges affectedRanges) throws IncorrectOperationException {
      try {
      validateModel(model);
      SequentialTask task = new MyFormattingTask() {
        @Override
        protected @NotNull FormatProcessor buildProcessor() {
          FormatOptions options = new FormatOptions(settings, indentOptions, affectedRanges);
          FormatProcessor processor = new FormatProcessor(
            model.getDocumentModel(), model.getRootBlock(), options, getProgressCallback()
          );
          processor.format(model, true);
          return processor;
        }
      };
      execute(task);
    }
    catch (FormattingModelInconsistencyException e) {
      LOG.error(e);
    }
  }
@Override
  public void format(final FormattingModel model,
                     final CodeStyleSettings settings,
                     final CommonCodeStyleSettings.IndentOptions indentOptions,
                     final FormatTextRanges affectedRanges)