String () { JavaCodeFragment file = JavaCodeFragmentFactory.getInstance(project).createCodeBlockCodeFragment(myOrigText, myFile, false); WriteCommandAction.runWriteCommandAction(myProject, RefactorJBundle.message("codestyle.settings.extractor.command.name"), "CodeStyleSettings extractor", () -> { ASTNode treeElement = SourceTreeToPsiMap.psiToTreeNotNull(file); SourceTreeToPsiMap.treeElementToPsi(new CodeFormatterFacade(mySettings, file.getLanguage()).processElement(treeElement)); }, file); return file.getText(); }