private static PsiElement formatElement(@NotNull FormattingService service,
                                          @NotNull PsiElement element,
                                          @NotNull TextRange range,
                                          boolean canChangeWhiteSpacesOnly,
                                          boolean forceAsync) {
    if (forceAsync && (service instanceof CoreFormattingService)) {
      ((CoreFormattingService)service).asyncFormatElement(element, range, canChangeWhiteSpacesOnly);
      return element;
    }
    else {
      return service.formatElement(element, range, canChangeWhiteSpacesOnly);
    }
  }
private static PsiElement formatElement(@NotNull FormattingService service,
                                          @NotNull PsiElement element,
                                          @NotNull TextRange range,
                                          boolean canChangeWhiteSpacesOnly,
                                          boolean forceAsync)