@Override
  public void format(@NotNull Project project,
                     @NotNull Editor editor,
                     int howtoReformat,
                     int startOffset,
                     int endOffset,
                     int anchorColumn,
                     boolean indentBeforeReformat,
                     boolean formatInjected) {
    if (formatInjected && !(editor instanceof EditorWindow)) {
      PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
      PsiFile psiFile = psiDocumentManager.getPsiFile(editor.getDocument());
      if (psiFile != null) {
        final List<DocumentWindow> injectedDocuments = InjectedLanguageManager.getInstance(project)
          .getCachedInjectedDocumentsInRange(psiFile, new TextRange(startOffset, endOffset));
        for (DocumentWindow injectedDocument : injectedDocuments) {
          PsiFile injectedPsiFile = psiDocumentManager.getPsiFile(injectedDocument);
          if (injectedPsiFile == null || CodeFormatterFacade.shouldDelegateToTopLevel(injectedPsiFile)) {
            continue;
          }
          @SuppressWarnings("deprecation")
          Editor injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedPsiFile);
          int injectedStartOffset = max(0, injectedDocument.hostToInjected(startOffset));
          int injectedEndOffset = min(injectedDocument.getTextLength(), injectedDocument.hostToInjected(endOffset));

          doFormat(project, injectedEditor, howtoReformat, injectedStartOffset, injectedEndOffset, anchorColumn, indentBeforeReformat);
        }
      }
    }

    doFormat(project, editor, howtoReformat, startOffset, endOffset, anchorColumn, indentBeforeReformat);
  }
@Override
  public void format(@NotNull Project project,
                     @NotNull Editor editor,
                     int howtoReformat,
                     int startOffset,
                     int endOffset,
                     int anchorColumn,
                     boolean indentBeforeReformat,
                     boolean formatInjected)