public static void reformatWithFileContext(@NotNull PsiFile fileToReformat, @NotNull PsiFile contextFile) {
    final Project project = contextFile.getProject();
    CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);
    CodeStyleSettings realFileSettings = getSettings(contextFile);
    runWithLocalSettings(project, realFileSettings, () -> codeStyleManager.reformat(fileToReformat));
  }
public static void reformatWithFileContext(@NotNull PsiFile fileToReformat, @NotNull PsiFile contextFile)