@Override
  public int adjustLineIndent(final FormattingModel model,
                              final CodeStyleSettings settings,
                              final CommonCodeStyleSettings.IndentOptions indentOptions,
                              final int offset,
                              final TextRange affectedRange) throws IncorrectOperationException {
    try {
      validateModel(model);
      if (model instanceof PsiBasedFormattingModel) {
        ((PsiBasedFormattingModel)model).canModifyAllWhiteSpaces();
      }
      final FormattingDocumentModel documentModel = model.getDocumentModel();
      final FormatProcessor processor = buildProcessorAndWrapBlocks(model, settings, indentOptions, affectedRange, offset);
      final LeafBlockWrapper blockAfterOffset = processor.getBlockRangesMap().getBlockAtOrAfter(offset);
      if (blockAfterOffset != null && blockAfterOffset.contains(offset)) {
        return offset;
      }
      WhiteSpace whiteSpace = blockAfterOffset != null ? blockAfterOffset.getWhiteSpace() : processor.getLastWhiteSpace();
      return adjustLineIndent(offset, documentModel, processor, indentOptions, model, whiteSpace,
                              blockAfterOffset != null ? blockAfterOffset.getNode() : null);
    }
    catch (FormattingModelInconsistencyException e) {
      LOG.error(e);
    }
    return offset;
  }
@Override
  public int adjustLineIndent(final FormattingModel model,
                              final CodeStyleSettings settings,
                              final CommonCodeStyleSettings.IndentOptions indentOptions,
                              final int offset,
                              final TextRange affectedRange)