mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
comments support for show desc
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.lang.documentation.ExternalDocumentationProvider;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.tasks.Comment;
|
||||
import com.intellij.tasks.Task;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -57,10 +58,20 @@ public class TaskDocumentationProvider extends AbstractDocumentationProvider imp
|
||||
if (task.getDescription() != null) {
|
||||
builder.append("<b>Description:</b><br>").append(task.getDescription());
|
||||
}
|
||||
for (Comment comment : task.getComments()) {
|
||||
addComment(builder, comment);
|
||||
}
|
||||
builder.append("</html>");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private static void addComment(final StringBuilder builder, final Comment comment) {
|
||||
builder.append("<hr>");
|
||||
builder.append("<b>Author:</b> ").append(comment.getAuthor()).append("<br>");
|
||||
builder.append("<b>Date:</b> ").append(comment.getDate()).append("<br>");
|
||||
builder.append(comment.getText()).append("<br>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
|
||||
return object instanceof Task ? new TaskPsiElement(psiManager, (Task)object): null;
|
||||
|
||||
Reference in New Issue
Block a user