void (@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)); }