public void asyncFormatElement(@NotNull PsiElement element, @NotNull TextRange range, boolean canChangeWhitespaceOnly) {
    if (ApplicationManager.getApplication().isUnitTestMode() || ApplicationManager.getApplication().isHeadlessEnvironment()) {
      formatElement(element, range, canChangeWhitespaceOnly);
      return;
    }
    AsyncFormattingService.getInstance().asyncFormatElement(this, element, range, canChangeWhitespaceOnly);
  }
public void asyncFormatElement(@NotNull PsiElement element, @NotNull TextRange range, boolean canChangeWhitespaceOnly)