FutureTask<Boolean> (@NotNull final PsiFile file, final boolean processChangedTextOnly) { return new FutureTask<>(() -> { try { Collection<TextRange> ranges = getRangesToFormat(file, processChangedTextOnly); Document document = PsiDocumentManager.getInstance(myProject).getDocument(file); if (document != null && Rearranger.EXTENSION.forLanguage(file.getLanguage()) != null) { PsiDocumentManager.getInstance(myProject).doPostponedOperationsAndUnblockDocument(document); PsiDocumentManager.getInstance(myProject).commitDocument(document); Runnable command = prepareRearrangeCommand(file, ranges); try { CommandProcessor.getInstance().executeCommand(myProject, command, CodeInsightBundle.message("command.rearrange.code"), null); } finally { PsiDocumentManager.getInstance(myProject).commitDocument(document); } } return true; } catch (FilesTooBigForDiffException e) { handleFileTooBigException(LOG, e, file); return false; } }); }