void (final PsiFile file) { try { if (myTextRange == null) { CodeStyleManager.getInstance(getProject()).reformatText(file, 0, file.getTextLength()); } else { CodeStyleManager.getInstance(getProject()).reformatText(file, myTextRange.getStartOffset(), myTextRange.getEndOffset()); } } catch (IncorrectOperationException e) { fail(); } }