private static void reformatRange(final @NotNull PsiFile file, final @NotNull TextRange range) {
    final Project project = file.getProject();
    CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(() -> CodeStyleManager.getInstance(project).reformatText(file, range.getStartOffset(), range.getEndOffset())),
                                                  CodeStyleBundle.message("command.name.reformat"), null);
  }
private static void reformatRange(final @NotNull PsiFile file, final @NotNull TextRange range)