mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
fix(JavaDoc): Collapsed markdown comments with wrong suffixes
Not perfect at all, it should be able to rely on the commenter API instead. GitOrigin-RevId: f41d181e9f27905bca1156912b7850f5a96ba943
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d4e45d6061
commit
286567da08
@@ -198,7 +198,19 @@ public abstract class JavaFoldingBuilderBase extends CustomFoldingBuilder implem
|
||||
final FoldingDescriptor commentDescriptor = CommentFoldingUtil.getCommentDescriptor(comment, document, processedComments,
|
||||
element -> isCustomRegionElement(element),
|
||||
isCollapseCommentByDefault(comment));
|
||||
if (commentDescriptor != null) list.add(commentDescriptor);
|
||||
if (commentDescriptor != null) {
|
||||
if (comment instanceof PsiDocComment && ((PsiDocComment)comment).isMarkdownComment()) {
|
||||
// Hack: Markdown comments aren't documented in the Commenter for the Java language
|
||||
// To avoid the `/** */` tokens, we remove them
|
||||
String placeHolderText = commentDescriptor.getPlaceholderText();
|
||||
if (placeHolderText != null) {
|
||||
placeHolderText = StringUtil.trimEnd(StringUtil.trimStart(placeHolderText, "/**"), "*/");
|
||||
commentDescriptor.setPlaceholderText(placeHolderText);
|
||||
}
|
||||
}
|
||||
|
||||
list.add(commentDescriptor);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addMethodGenericParametersFolding(@NotNull List<? super FoldingDescriptor> list,
|
||||
|
||||
Reference in New Issue
Block a user