void (@NotNull PsiFile file, FormattingRangesInfo rangesInfo, boolean canChangeWhiteSpaceOnly, boolean quickFormat) { TextRange boundRange = ObjectUtils.notNull(rangesInfo.getBoundRange(), file.getTextRange()); FormattingContext formattingContext = FormattingContext.create(file, boundRange, CodeStyle.getSettings(file), FormattingMode.REFORMAT); PsiDocumentManager documentManager = PsiDocumentManager.getInstance(file.getProject()); Document document = documentManager.getDocument(file); if (document != null) { formatDocument(document, rangesInfo.getTextRanges(), formattingContext, canChangeWhiteSpaceOnly, quickFormat); documentManager.commitDocument(document); } }