void (@NotNull PsiMethod method, @NotNull PsiDocComment docComment) { PsiFile containingFile = method.getContainingFile(); if (containingFile == null) { return; } // Here we temporarily enable javadoc (we can't produce reasonable javadoc in change signature without formatting) // This is an explicit action which affects javadoc, so it shouldn't be unexpected for user. JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(containingFile); boolean javadocEnabled = settings.ENABLE_JAVADOC_FORMATTING; try { settings.ENABLE_JAVADOC_FORMATTING = true; CommentFormatter formatter = new CommentFormatter(method.getContainingFile()); formatter.processComment(docComment.getNode()); } finally { settings.ENABLE_JAVADOC_FORMATTING = javadocEnabled; } }