String (@NotNull Document document, @NotNull IElementType commentType, @NotNull TextRange commentRange, @NotNull String replacement) { final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(commentType.getLanguage()); if (!(commenter instanceof CodeDocumentationAwareCommenter)) return null; final CodeDocumentationAwareCommenter docCommenter = (CodeDocumentationAwareCommenter)commenter; final String placeholder; if (commentType == docCommenter.getLineCommentTokenType()) { placeholder = getLineCommentPlaceholderText(commenter, replacement); } else if (commentType == docCommenter.getBlockCommentTokenType()) { placeholder = getMultilineCommentPlaceholderText(commenter, replacement); } else if (commentType == docCommenter.getDocumentationCommentTokenType()) { placeholder = getDocCommentPlaceholderText(document, docCommenter, commentRange, replacement); } else { placeholder = null; } return placeholder; }