下面列出了怎么用com.intellij.psi.impl.source.tree.PsiCommentImpl的API类实例代码及写法,或者点击链接到github查看源代码。
private static String parseComment(PsiField field) {
if(field == null){
return StringUtils.EMPTY;
}
PsiElement[] children = field.getChildren();
for (PsiElement child : children) {
String text = child.getText();
if(child instanceof PsiDocCommentImpl || child instanceof PsiCommentImpl){
return formatText(text);
}
}
return StringUtils.EMPTY;
}
@Nullable
@Override
public LeafElement createLeaf(IElementType type, CharSequence text) {
if (HaxeTokenTypeSets.COMMENTS.contains(type)) {
return new PsiCommentImpl(type, text);
}
return new HaxePsiTokenImpl(type, text);
}
public CommentLiteralEscaper(PsiCommentImpl host) {
super(host);
}