void (@NotNull PsiFile file, @NotNull Project project, int start, int end) { CodeStyle.doWithTemporarySettings( project, CodeStyle.getSettings(file), tempSettings -> { LanguageCodeStyleSettingsProvider langProvider = LanguageCodeStyleSettingsProvider.forLanguage(file.getLanguage()); if (langProvider != null) { DocCommentSettings docCommentSettings = langProvider.getDocCommentSettings(tempSettings); docCommentSettings.setRemoveEmptyTags(false); } CodeStyleManager.getInstance(project).reformatText(file, start, end); }); }