use of com.intellij.codeInsight.actions.OptimizeImportsProcessor in project intellij-plugins by StepicOrg.
the class ReformatUtils method reformatSelectedEditor.
public static void reformatSelectedEditor(@NotNull Project project, @NotNull Document document) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
if (file == null)
return;
new ReformatCodeProcessor(new OptimizeImportsProcessor(project, file), false).run();
}
Aggregations