void (@NotNull Document document, @NotNull List<TextRange> formattingRanges, @NotNull FormattingContext formattingContext, boolean canChangeWhiteSpaceOnly, boolean quickFormat) { for (TextRange range : formattingRanges) { document.replaceString( range.getStartOffset(), range.getEndOffset(), getFormatted( document.getCharsSequence().subSequence(range.getStartOffset(), range.getEndOffset()))); } }